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(())
}
// TODO: maybe refactor into an Iterator for lazy evaluation.
// Maybe this can be refactored into an Iterator for lazy evaluation.
pub fn fetch_feeds(
connection: Arc<Mutex<SqliteConnection>>,
force: bool,

View File

@ -66,24 +66,22 @@ lazy_static!{
};
}
// TODO: REFACTOR
pub fn init() -> Result<()> {
let conn = establish_connection();
// embedded_migrations::run(&conn)?;
embedded_migrations::run_with_output(&conn, &mut std::io::stdout())?;
run_migration_on(&conn)?;
Ok(())
}
pub fn run_migration_on(connection: &SqliteConnection) -> Result<()> {
info!("Running DB Migrations...");
// embedded_migrations::run(&conn)?;
embedded_migrations::run_with_output(connection, &mut std::io::stdout())?;
Ok(())
}
pub fn establish_connection() -> SqliteConnection {
let database_url = DB_PATH.to_str().unwrap();
// let database_url = &String::from(".random/foo.db");
SqliteConnection::establish(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)]
#[table_name = "source"]
#[derive(Debug, Clone)]