This commit is contained in:
Mateusz Gruszczyński committed 2026-10-31 23:42:58 +01:00
1 parent 2c03fcf248
commit d3b492874b
95 files changed
+1628 -743

No files matched your search

+5 -5
View File
@@ -3,7 +3,7 @@ fn parse_key_hex(value: &str) -> Option<Key> {
return None;
}
let mut key = [0_u8; 32];
for (index, chunk) in value.as_bytes().chunks_exact(2).enumerate() {
for (index, chunk) in value.as_bytes().as_chunks::<2>().0.iter().enumerate() {
let text = std::str::from_utf8(chunk).ok()?;
key[index] = u8::from_str_radix(text, 16).ok()?;
}
@@ -137,13 +137,13 @@ fn stale_mode(
if matches!(max_stale, Some(Some(limit)) if stale_for > limit) {
return None;
}
if max_stale.is_some() {
return Some(false);
}
if stale_while_revalidate > 0 && stale_for <= stale_while_revalidate {
return Some(true);
}
match max_stale {
Some(None) | Some(Some(_)) => Some(false),
None => None,
}
None
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]