Cleaned some minor TODO's.

This commit is contained in:
Jordan Petridis 2017-10-05 19:09:59 +03:00
parent 78454f6474
commit 423e0a6e7b
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
3 changed files with 3 additions and 6 deletions

View File

@ -149,7 +149,7 @@ fn index_channel_items(
Ok(()) Ok(())
} }
// TODO: maybe refactor into an Iterator for lazy evaluation. // Maybe this can be refactored into an Iterator for lazy evaluation.
pub fn fetch_feeds( pub fn fetch_feeds(
connection: Arc<Mutex<SqliteConnection>>, connection: Arc<Mutex<SqliteConnection>>,
force: bool, force: bool,

View File

@ -66,24 +66,22 @@ lazy_static!{
}; };
} }
// TODO: REFACTOR
pub fn init() -> Result<()> { pub fn init() -> Result<()> {
let conn = establish_connection(); let conn = establish_connection();
// embedded_migrations::run(&conn)?; run_migration_on(&conn)?;
embedded_migrations::run_with_output(&conn, &mut std::io::stdout())?;
Ok(()) Ok(())
} }
pub fn run_migration_on(connection: &SqliteConnection) -> Result<()> { pub fn run_migration_on(connection: &SqliteConnection) -> Result<()> {
info!("Running DB Migrations..."); info!("Running DB Migrations...");
// embedded_migrations::run(&conn)?;
embedded_migrations::run_with_output(connection, &mut std::io::stdout())?; embedded_migrations::run_with_output(connection, &mut std::io::stdout())?;
Ok(()) Ok(())
} }
pub fn establish_connection() -> SqliteConnection { pub fn establish_connection() -> SqliteConnection {
let database_url = DB_PATH.to_str().unwrap(); let database_url = DB_PATH.to_str().unwrap();
// let database_url = &String::from(".random/foo.db");
SqliteConnection::establish(database_url) SqliteConnection::establish(database_url)
.expect(&format!("Error connecting to {}", database_url)) .expect(&format!("Error connecting to {}", database_url))
} }

View File

@ -198,7 +198,6 @@ impl<'a> Source {
} }
} }
// TODO: Remove pub fields and add setters.
#[derive(Insertable)] #[derive(Insertable)]
#[table_name = "source"] #[table_name = "source"]
#[derive(Debug, Clone)] #[derive(Debug, Clone)]