Clean up comments

This commit is contained in:
Silas Brack 2026-03-08 13:31:44 +01:00
parent 5cdaeddc0e
commit 5daa983034
3 changed files with 5 additions and 31 deletions

View file

@ -12,9 +12,7 @@ struct NginxEntry {
size: Option<i64>,
}
/// Pure: merge volume scan results into a unified index.
/// Each scan is (volume_url, list of (key, size) pairs).
/// Returns a map of key -> (volumes containing it, max size seen).
/// If a key has different sizes across volumes, takes the max.
pub fn merge_volume_scans(
scans: &[(String, Vec<(String, i64)>)],
) -> HashMap<String, (Vec<String>, i64)> {
@ -77,7 +75,6 @@ pub async fn run(args: &Args) {
let db = db::Db::new(db_path);
// I/O: scan each volume
let mut scans = Vec::new();
for vol_url in &args.volumes {
eprintln!("Scanning {vol_url}...");
@ -90,7 +87,6 @@ pub async fn run(args: &Args) {
}
}
// Pure: merge scan results
let index = merge_volume_scans(&scans);
let records: Vec<_> = index
@ -108,9 +104,7 @@ mod tests {
#[test]
fn test_merge_takes_max_size() {
// Edge case: same key with different sizes across volumes
// (can happen due to incomplete writes or corruption)
// We take the max size as the authoritative value
// Can happen due to incomplete writes or corruption
let scans = vec![
("http://vol1".to_string(), vec![("key".to_string(), 50)]),
("http://vol2".to_string(), vec![("key".to_string(), 200)]),