Skip to content

Commit

Permalink
refactor(term): remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Jun 13, 2024
1 parent 708cbf4 commit a46f99f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
23 changes: 0 additions & 23 deletions crates/synd_term/src/application/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
18 changes: 11 additions & 7 deletions crates/synd_term/src/application/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
})?;

Expand Down Expand Up @@ -64,12 +64,6 @@ impl Cache {
}
}

// impl Default for Cache {
// fn default() -> Self {
// Self::new(config::cache::dir())
// }
// }

#[cfg(test)]
mod tests {

Expand All @@ -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()
}
Expand Down

0 comments on commit a46f99f

Please sign in to comment.