diff options
author | metamuffin <metamuffin@disroot.org> | 2025-02-07 16:21:41 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-02-07 16:21:41 +0100 |
commit | 9ff2358adca561b7723e9c4d79efce87025d2e4e (patch) | |
tree | e5f4f2e35df718dd9bc65623cc625f7ac11c2811 /base | |
parent | 0bba75241d59c64375cfece494eb9dcdbaa664fc (diff) | |
download | jellything-9ff2358adca561b7723e9c4d79efce87025d2e4e.tar jellything-9ff2358adca561b7723e9c4d79efce87025d2e4e.tar.bz2 jellything-9ff2358adca561b7723e9c4d79efce87025d2e4e.tar.zst |
clippy
Diffstat (limited to 'base')
-rw-r--r-- | base/src/cache.rs | 4 | ||||
-rw-r--r-- | base/src/database.rs | 2 |
2 files changed, 3 insertions, 3 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 diff --git a/base/src/database.rs b/base/src/database.rs index 54ead92..407db29 100644 --- a/base/src/database.rs +++ b/base/src/database.rs @@ -144,7 +144,7 @@ impl Database { let txn = self.inner.begin_read()?; let t_node = txn.open_table(T_USER_NODE)?; if let Some(node) = t_node.get((username, id.0))? { - Ok(Some(node.value().0.into())) + Ok(Some(node.value().0)) } else { Ok(None) } |