Removed the Database type alias.

This commit is contained in:
Jordan Petridis
2017-11-19 22:39:51 +02:00
parent 55442529a8
commit 47b32ac000
6 changed files with 32 additions and 43 deletions
-2
View File
@@ -61,8 +61,6 @@ impl<'a> NewEpisode<'a> {
// TODO: Currently using diesel from master git.
// Watch out for v0.99.0 beta and change the toml.
// TODO: Refactor into batch indexes instead.
// TODO: Refactor so all index methods take consistent arguments
// like NewEpisode.index wants Sqliteconnection where the other take a Database
pub fn index(&self, con: &SqliteConnection) -> QueryResult<()> {
use schema::episode::dsl::*;
+4 -5
View File
@@ -10,7 +10,6 @@ use feed::Feed;
use errors::*;
use models::insertables::NewPodcast;
use Database;
use POOL;
use std::io::Read;
@@ -129,8 +128,8 @@ impl Episode {
self.favorite = b
}
pub fn save(&self, db: &Database) -> QueryResult<Episode> {
let tempdb = db.lock().unwrap();
pub fn save(&self) -> QueryResult<Episode> {
let tempdb = POOL.clone().get().unwrap();
self.save_changes::<Episode>(&*tempdb)
}
}
@@ -226,8 +225,8 @@ impl Podcast {
self.always_dl = b
}
pub fn save(&self, db: &Database) -> QueryResult<Podcast> {
let tempdb = db.lock().unwrap();
pub fn save(&self) -> QueryResult<Podcast> {
let tempdb = POOL.clone().get().unwrap();
self.save_changes::<Podcast>(&*tempdb)
}
}