Drop support for theme dir without reload
Reload here is super cheap, no point in maintaining a version with it disabled
- Id
- 93d9887d8b623b1757ad1c6d897868a38a559d1e
- Author
- Caio
- Commit time
- 2024-03-02T10:13:50+01:00
Modified caca/src/view.rs
use crate::repo::{Blob, Commit, GlobalFeed, Listing, Log, Refs, RepoFeed, Summary, Tree};
-#[derive(Debug, Clone)]
-#[allow(dead_code)]
+#[derive(Debug, Clone, PartialEq)]
pub(crate) enum Theme {
Static,
- Dir(String),
AutoReload(String),
}
pub(crate) fn dir(&self) -> std::io::Result<Option<std::path::PathBuf>> {
match self {
Theme::Static => Ok(None),
- Theme::Dir(n) | Theme::AutoReload(n) => {
- Some(Path::new(n).to_path_buf().canonicalize()).transpose()
- }
+ Theme::AutoReload(n) => Some(Path::new(n).to_path_buf().canonicalize()).transpose(),
}
}
pub(crate) fn env(&self) -> Result<minijinja::Environment<'static>, minijinja::Error> {
match self {
Theme::Static => static_env(),
- Theme::Dir(n) | Theme::AutoReload(n) => dir_env(n),
+ Theme::AutoReload(n) => dir_env(n),
}
}
}