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:
parent
0790d1ee42
commit
1205b9b04d
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue