aboutsummaryrefslogtreecommitdiff
path: root/base/src/cache.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-02-07 16:21:41 +0100
committermetamuffin <metamuffin@disroot.org>2025-02-07 16:21:41 +0100
commit9ff2358adca561b7723e9c4d79efce87025d2e4e (patch)
treee5f4f2e35df718dd9bc65623cc625f7ac11c2811 /base/src/cache.rs
parent0bba75241d59c64375cfece494eb9dcdbaa664fc (diff)
downloadjellything-9ff2358adca561b7723e9c4d79efce87025d2e4e.tar
jellything-9ff2358adca561b7723e9c4d79efce87025d2e4e.tar.bz2
jellything-9ff2358adca561b7723e9c4d79efce87025d2e4e.tar.zst
clippy
Diffstat (limited to 'base/src/cache.rs')
-rw-r--r--base/src/cache.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/base/src/cache.rs b/base/src/cache.rs
index e2b540b..d6aa15f 100644
--- a/base/src/cache.rs
+++ b/base/src/cache.rs
@@ -44,7 +44,7 @@ pub fn cache_location(seed: &[&str]) -> (usize, CachePath) {
d.update(b"\0");
}
let d = d.finalize();
- let n = d[0] as usize | (d[1] as usize) << 8 | (d[2] as usize) << 16 | (d[3] as usize) << 24;
+ let n = d[0] as usize | ((d[1] as usize) << 8) | ((d[2] as usize) << 16) | ((d[3] as usize) << 24);
let fname = base64::engine::general_purpose::URL_SAFE.encode(d);
let fname = &fname[..22];
let fname = format!("{}-{}", seed[0], fname); // about 128 bits
@@ -92,7 +92,7 @@ where
Ok(location)
}
-thread_local! { pub static WITHIN_CACHE_FILE: AtomicBool = AtomicBool::new(false); }
+thread_local! { pub static WITHIN_CACHE_FILE: AtomicBool = const { AtomicBool::new(false) }; }
pub fn cache_file<Fun>(seed: &[&str], mut generate: Fun) -> Result<CachePath, anyhow::Error>
where