Apply cargo fmt
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Valentin Brandl 2023-06-13 10:26:25 +02:00
parent 4ce8c9e523
commit 9f3c2813ab
2 changed files with 6 additions and 11 deletions

View File

@ -36,13 +36,10 @@ impl<'a> CacheState<'a> {
trace!("Reading cache"); trace!("Reading cache");
if path.as_ref().exists() { if path.as_ref().exists() {
let cache: Cache = serde_json::from_reader(BufReader::new(File::open(path)?))?; let cache: Cache = serde_json::from_reader(BufReader::new(File::open(path)?))?;
Ok(cache Ok(cache.entries.get(branch).map_or_else(
.entries
.get(branch)
.map_or_else(
// TODO: get rid of clone // TODO: get rid of clone
|| CacheState::NoneForBranch(cache.clone()), || CacheState::NoneForBranch(cache.clone()),
|c| { |c| {
if c.head == head { if c.head == head {
trace!("Cache is up to date"); trace!("Cache is up to date");
CacheState::Current { CacheState::Current {
@ -59,8 +56,8 @@ impl<'a> CacheState<'a> {
cache: cache.clone(), cache: cache.clone(),
} }
} }
}) },
) ))
} else { } else {
Ok(CacheState::No) Ok(CacheState::No)
} }

View File

@ -501,9 +501,7 @@ async fn static_file(
.content_type(data.mime.clone()) .content_type(data.mime.clone())
.body(data.content) .body(data.content)
}) })
.map_or_else( .map_or_else(|| p404(&repo_count), Result::Ok)
|| p404(&repo_count),
Result::Ok)
} }
#[get("/favicon.ico")] #[get("/favicon.ico")]