From 132c9bbdff681242705a8fd7e232cb3440feb8e0 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Mon, 30 Jul 2018 23:23:58 +0300 Subject: [PATCH] ShowModel: Remove dead unused methods. --- podcasts-data/src/models/show.rs | 34 +------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/podcasts-data/src/models/show.rs b/podcasts-data/src/models/show.rs index 85a35d5..6fc4bba 100644 --- a/podcasts-data/src/models/show.rs +++ b/podcasts-data/src/models/show.rs @@ -1,8 +1,4 @@ -use diesel::SaveChangesDsl; - -use database::connection; -use errors::DataError; -use models::{Save, Source}; +use models::Source; use schema::shows; #[derive(Queryable, Identifiable, AsChangeset, Associations, PartialEq)] @@ -20,19 +16,6 @@ pub struct Show { source_id: i32, } -impl Save for Show { - type Error = DataError; - - /// Helper method to easily save/"sync" current state of self to the - /// Database. - fn save(&self) -> Result { - let db = connection(); - let tempdb = db.get()?; - - self.save_changes::(&*tempdb).map_err(From::from) - } -} - impl Show { /// Get the Feed `id`. pub fn id(&self) -> i32 { @@ -51,21 +34,11 @@ impl Show { &self.link } - /// Set the Show/Feed `link`. - pub fn set_link(&mut self, value: &str) { - self.link = value.to_string(); - } - /// Get the `description`. pub fn description(&self) -> &str { &self.description } - /// Set the `description`. - pub fn set_description(&mut self, value: &str) { - self.description = value.to_string(); - } - /// Get the `image_uri`. /// /// Represents the uri(url usually) that the Feed cover image is located at. @@ -73,11 +46,6 @@ impl Show { self.image_uri.as_ref().map(|s| s.as_str()) } - /// Set the `image_uri`. - pub fn set_image_uri(&mut self, value: Option<&str>) { - self.image_uri = value.map(|x| x.to_string()); - } - /// `Source` table foreign key. pub fn source_id(&self) -> i32 { self.source_id