diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-01-08 10:12:19 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-01-08 10:12:19 +0200 |
| commit | f19c7e6a41768e73a0f727deb22d65f1646a0777 (patch) | |
| tree | 664e6e477d5be5e2c1e49a2d73d2bf4ec6ad521a /log_db/src/common.rs | |
| parent | bb64bc35beea7e0c46407b42a6240f084ccd137a (diff) | |
Replace iter() calls with into_iter(), add consistency asserts
Diffstat (limited to 'log_db/src/common.rs')
| -rw-r--r-- | log_db/src/common.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/log_db/src/common.rs b/log_db/src/common.rs index 8bdcd9a..1841175 100644 --- a/log_db/src/common.rs +++ b/log_db/src/common.rs @@ -104,22 +104,6 @@ impl LogKeySet { LogKeySet { set } } - pub fn from_slice(keys: &[LogKey]) -> Self { - assert!( - !keys.is_empty(), - "LogKeySet::from_slice must be supplied a non-empty slice" - ); - let mut set = HashSet::with_capacity(keys.len()); - keys.iter().for_each(|key| { - set.insert(key.clone()); - }); - LogKeySet { set } - } - - pub fn iter(&self) -> std::collections::hash_set::Iter<'_, LogKey> { - self.set.iter() - } - pub fn contains(&self, key: &LogKey) -> bool { self.set.contains(key) } @@ -784,13 +768,3 @@ pub fn request_exclusive_lock(data_dir: &Path, file: &mut fs::File) -> Result<() Ok(()) } - -macro_rules! dbg_trace { - ($($args: expr),*) => { - print!("TRACE: file: {}, line: {}", file!(), line!()); - $( - print!(", {}: {:?}", stringify!($args), $args); - )* - println!(""); // to get a new line at the end - } -} |
