Cleanup the id() method mess of the diesel models.
This commit is contained in:
@@ -21,10 +21,6 @@ rayon = "0.9.0"
|
||||
regex = "0.2.3"
|
||||
send-cell = "0.1.2"
|
||||
|
||||
[dependencies.diesel]
|
||||
features = ["sqlite"]
|
||||
version = "1.0.0"
|
||||
|
||||
[dependencies.gtk]
|
||||
features = ["v3_22"]
|
||||
version = "0.3.0"
|
||||
|
||||
@@ -7,7 +7,6 @@ extern crate glib;
|
||||
extern crate gtk;
|
||||
|
||||
extern crate chrono;
|
||||
extern crate diesel;
|
||||
extern crate dissolve;
|
||||
extern crate hammond_data;
|
||||
extern crate hammond_downloader;
|
||||
|
||||
@@ -117,7 +117,6 @@ pub fn add(id: i32, directory: &str, sender: Sender<Action>) {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use diesel::Identifiable;
|
||||
|
||||
use hammond_data::database;
|
||||
use hammond_data::utils::get_download_folder;
|
||||
@@ -141,7 +140,7 @@ mod tests {
|
||||
// Create and index a source
|
||||
let mut source = Source::from_url(url).unwrap();
|
||||
// Copy it's id
|
||||
let sid = source.id().clone();
|
||||
let sid = source.id();
|
||||
|
||||
// Convert Source it into a Feed and index it
|
||||
let feed = source.into_feed(true).unwrap();
|
||||
@@ -152,7 +151,7 @@ mod tests {
|
||||
// Get an episode
|
||||
let episode: Episode = {
|
||||
let con = database::connection();
|
||||
dbqueries::get_episode_from_pk(&*con.get().unwrap(), "e000: Hello, world!", *pd.id())
|
||||
dbqueries::get_episode_from_pk(&*con.get().unwrap(), "e000: Hello, world!", pd.id())
|
||||
.unwrap()
|
||||
};
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ mod tests {
|
||||
use hammond_data::Source;
|
||||
use hammond_data::feed::index;
|
||||
use hammond_data::dbqueries;
|
||||
use diesel::associations::Identifiable;
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
@@ -83,7 +82,7 @@ mod tests {
|
||||
// Create and index a source
|
||||
let mut source = Source::from_url(url).unwrap();
|
||||
// Copy it's id
|
||||
let sid = source.id().clone();
|
||||
let sid = source.id();
|
||||
|
||||
// Convert Source it into a Feed and index it
|
||||
let feed = source.into_feed(true).unwrap();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use gtk;
|
||||
use gtk::prelude::*;
|
||||
use diesel::associations::Identifiable;
|
||||
|
||||
use hammond_data::dbqueries;
|
||||
use hammond_data::Podcast;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use gtk::prelude::*;
|
||||
use gtk;
|
||||
use diesel::Identifiable;
|
||||
use open;
|
||||
use dissolve;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user