diff --git a/crates/synd_term/src/application/app_config.rs b/crates/synd_term/src/application/app_config.rs index 7ccfa531..89cfa897 100644 --- a/crates/synd_term/src/application/app_config.rs +++ b/crates/synd_term/src/application/app_config.rs @@ -31,27 +31,4 @@ impl Config { ..self } } - - #[must_use] - pub fn with_throbber_timer_interval(self, throbber_timer_interval: Duration) -> Self { - Self { - throbber_timer_interval, - ..self - } - } - #[must_use] - pub fn with_entries_per_pagination(self, entries_per_pagination: u16) -> Self { - Self { - entries_per_pagination: i64::from(entries_per_pagination), - ..self - } - } - - #[must_use] - pub fn with_feeds_per_pagination(self, feeds_per_pagination: u16) -> Self { - Self { - feeds_per_pagination: i64::from(feeds_per_pagination), - ..self - } - } } diff --git a/crates/synd_term/src/application/cache/mod.rs b/crates/synd_term/src/application/cache/mod.rs index 3a0354c1..fc38b6fe 100644 --- a/crates/synd_term/src/application/cache/mod.rs +++ b/crates/synd_term/src/application/cache/mod.rs @@ -23,7 +23,7 @@ impl Cache { std::fs::create_dir_all(self.dir.as_path()).map_err(|err| { CredentialError::PersistCredential { io_err: err, - path: path.clone(), + path: self.dir.clone(), } })?; @@ -64,12 +64,6 @@ impl Cache { } } -// impl Default for Cache { -// fn default() -> Self { -// Self::new(config::cache::dir()) -// } -// } - #[cfg(test)] mod tests { @@ -90,6 +84,16 @@ mod tests { assert_eq!(loaded, Unverified::from(cred),); } + #[test] + fn filesystem_error() { + let cache = Cache::new("/dev/null"); + assert!(cache + .persist_credential(Credential::Github { + access_token: "dummy".into(), + }) + .is_err()); + } + fn temp_dir() -> PathBuf { tempfile::TempDir::new().unwrap().into_path() }