Name the folder lookup the merge page is handed, for clippy

This commit is contained in:
2026-09-28 19:57:37 -04:00
parent 3b7d7129ff
commit 34630ff752
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -228,7 +228,7 @@ mod tests {
// (0,0),(1,0),(0,1),(1,1) → 0, 10, 1, 11: mean 5.5, rounded. // (0,0),(1,0),(0,1),(1,1) → 0, 10, 1, 11: mean 5.5, rounded.
assert_eq!(at(0, 0), 6); assert_eq!(at(0, 0), 6);
// The right-hand column is one pixel wide: (4,0) and (4,1). // The right-hand column is one pixel wide: (4,0) and (4,1).
assert_eq!(at(2, 0), (40 + 41 + 1) / 2); assert_eq!(at(2, 0), 41, "40 and 41, rounded");
// The bottom-right is a single pixel. // The bottom-right is a single pixel.
assert_eq!(at(2, 1), 42); assert_eq!(at(2, 1), 42);
assert!(out.chunks_exact(3).all(|p| p[2] == 1000)); assert!(out.chunks_exact(3).all(|p| p[2] == 1000));
+4 -1
View File
@@ -97,13 +97,16 @@ impl MergeController {
} }
} }
/// The names a library folder holds, by folder.
pub type NamesIn = Box<dyn Fn(&str) -> std::collections::HashSet<String>>;
/// What the page needs from the library to start: the account for the /// What the page needs from the library to start: the account for the
/// fetch, where the outbox is, and the names a library folder already /// fetch, where the outbox is, and the names a library folder already
/// holds, so the composite is not named over one of them. /// holds, so the composite is not named over one of them.
pub struct Context { pub struct Context {
pub conn: dr_sync::Connection, pub conn: dr_sync::Connection,
pub outbox: std::path::PathBuf, pub outbox: std::path::PathBuf,
pub names_in: Box<dyn Fn(&str) -> std::collections::HashSet<String>>, pub names_in: NamesIn,
} }
/// Wire the page. `sources` yields the selection as fetchable library /// Wire the page. `sources` yields the selection as fetchable library