cultcache-rs: rows_at_key takes a static-keyed table; drop a stray mut

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-27 19:21:29 +01:00
commit 1205b9b04d

View file

@ -3017,7 +3017,7 @@ fn read_redb_entry(
/// Every row a redb table holds at `key`, whatever its type. Identities sort by their encoded (type, key), and every row of one
/// type shares the prefix `0x92` + msgpack str(type), so the types are walked by skip-scan: read the first row at or after a
/// bound, point-get that type's row at `key`, then continue from the successor of the type's prefix. O(types x log n), not O(n).
fn rows_at_key<'a>(table: &impl ReadableTable<&'a [u8], &'a [u8]>, key: &str) -> Result<Vec<CultCacheEnvelope>> {
fn rows_at_key(table: &impl ReadableTable<&'static [u8], &'static [u8]>, key: &str) -> Result<Vec<CultCacheEnvelope>> {
let mut rows = Vec::new();
let mut lower = Vec::<u8>::new();
loop {
@ -9351,7 +9351,7 @@ mod tests {
let row = test_envelope(kind, key, b"p");
table.insert(redb_identity(&row)?.as_slice(), rmp_serde::to_vec(&row)?.as_slice())?;
}
let mut at = |key: &str| -> Result<Vec<String>> {
let at = |key: &str| -> Result<Vec<String>> {
let mut types: Vec<String> = rows_at_key(&table, key)?.into_iter().map(|row| row.r#type).collect();
types.sort();
Ok(types)