diff options
Diffstat (limited to 'base/src/cache.rs')
-rw-r--r-- | base/src/cache.rs | 4 |
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 |