Fix clippy complaints.

This commit is contained in:
Kris Nuttycombe 2023-03-13 11:42:57 -06:00
parent ac6e8e8212
commit d7a04122ea
4 changed files with 5 additions and 6 deletions

View File

@ -136,7 +136,7 @@ impl Level {
// TODO: replace with an instance for `Step<Level>` once `step_trait`
// is stabilized
pub fn iter_to(self, other: Level) -> impl Iterator<Item = Self> {
(self.0..other.0).into_iter().map(Level)
(self.0..other.0).map(Level)
}
}

View File

@ -716,7 +716,6 @@ pub fn check_witnesses<T: Tree<String, usize> + std::fmt::Debug, F: Fn(usize) ->
);
let ops = ('a'..='l')
.into_iter()
.map(|c| Append(c.to_string(), Marked))
.chain(Some(Append('m'.to_string(), Ephemeral)))
.chain(Some(Append('n'.to_string(), Ephemeral)))

View File

@ -342,7 +342,7 @@ mod tests {
#[test]
fn correct_root() {
const DEPTH: u8 = 3;
let values = (0..(1 << DEPTH)).into_iter().map(SipHashable);
let values = (0..(1 << DEPTH)).map(SipHashable);
let mut tree = CompleteTree::<SipHashable, (), DEPTH>::new(100, ());
for value in values {
@ -391,7 +391,7 @@ mod tests {
use crate::{testing::Tree, Retention};
const DEPTH: u8 = 3;
let values = (0..(1 << DEPTH)).into_iter().map(SipHashable);
let values = (0..(1 << DEPTH)).map(SipHashable);
let mut tree = CompleteTree::<SipHashable, (), DEPTH>::new(100, ());
for value in values {

View File

@ -1819,7 +1819,7 @@ impl<
.and_modify(|to_clear| {
to_clear
.entry(pos)
.and_modify(|flags| *flags = *flags | RetentionFlags::CHECKPOINT)
.and_modify(|flags| *flags |= RetentionFlags::CHECKPOINT)
.or_insert(RetentionFlags::CHECKPOINT);
})
.or_insert_with(|| BTreeMap::from([(pos, RetentionFlags::CHECKPOINT)]));
@ -1833,7 +1833,7 @@ impl<
.and_modify(|to_clear| {
to_clear
.entry(*unmark_pos)
.and_modify(|flags| *flags = *flags | RetentionFlags::MARKED)
.and_modify(|flags| *flags |= RetentionFlags::MARKED)
.or_insert(RetentionFlags::MARKED);
})
.or_insert_with(|| BTreeMap::from([(*unmark_pos, RetentionFlags::MARKED)]));