Skip to content

Commit 49bbd2c

Browse files
committed
thanks clippy
1 parent b5377bc commit 49bbd2c

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/interactive/app/tests/utils.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ fn delete_recursive(path: impl AsRef<Path>) -> Result<()> {
114114
.sorted_by_key(|p| p.components().count())
115115
.rev()
116116
.map(|d| {
117-
remove_dir(d)
118-
.with_context(|| format!("Could not delete '{}'", d.display()))
119-
.map_err(Error::from)
117+
remove_dir(d).with_context(|| format!("Could not delete '{}'", d.display()))
120118
}),
121119
)
122120
.collect::<Result<_, _>>()

src/interactive/widgets/entries.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl Entries {
9191
let name = bundle.name.as_path();
9292

9393
let is_marked = marked.map(|m| m.contains_key(node_idx)).unwrap_or(false);
94-
let is_selected = selected.map_or(false, |idx| idx == *node_idx);
94+
let is_selected = selected == &Some(*node_idx);
9595
if is_selected {
9696
scroll_offset = Some(idx);
9797
}
@@ -287,7 +287,7 @@ fn fill_background_to_right(mut s: Cow<'_, str>, entire_width: u16) -> Cow<'_, s
287287
match (s.len(), entire_width as usize) {
288288
(x, y) if x >= y => s,
289289
(x, y) => {
290-
s.to_mut().extend(std::iter::repeat(' ').take(y - x));
290+
s.to_mut().extend(std::iter::repeat_n(' ', y - x));
291291
s
292292
}
293293
}

src/interactive/widgets/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl MainWindow {
139139
self.mark_pane
140140
.as_ref()
141141
.map(|p| p.marked())
142-
.map_or(true, |m| m.is_empty())
142+
.is_none_or(|m| m.is_empty())
143143
}
144144
}
145145

0 commit comments

Comments
 (0)