caio.co/de/caca

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

@@ -8,11 +8,9

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),
}

@@ -20,9 +18,7
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(),
}
}

@@ -33,7 +29,7
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),
}
}
}