Skip to content

Commit 092a6c5

Browse files
committed
thanks clippy
1 parent 73224e6 commit 092a6c5

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/interactive/app/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ pub fn sorted_entries(
109109
tree.neighbors_directed(node_idx, Direction::Outgoing)
110110
.filter_map(|idx| {
111111
tree.node_weight(idx).map(|entry| {
112-
let use_glob_path = glob_root.map_or(false, |glob_root| glob_root == node_idx);
112+
let use_glob_path = glob_root.is_some_and(|glob_root| glob_root == node_idx);
113113
let (path, exists, is_dir) = {
114114
let path = path_of(tree, idx, glob_root);
115115
if matches!(check, EntryCheck::Disabled) || glob_root == Some(node_idx) {
116116
(path, true, entry.is_dir)
117117
} else {
118118
let meta = path.symlink_metadata();
119-
(path, meta.is_ok(), meta.ok().map_or(false, |m| m.is_dir()))
119+
(path, meta.is_ok(), meta.ok().is_some_and(|m| m.is_dir()))
120120
}
121121
};
122122
EntryDataBundle {

src/interactive/app/tests/journeys_readonly.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@ fn simple_user_journey_read_only() -> Result<()> {
315315
"it marks only a single node",
316316
);
317317
assert!(
318-
app.window.mark_pane.as_ref().map_or(false, |p| p
319-
.marked()
320-
.contains_key(&previously_selected_index)),
318+
app.window
319+
.mark_pane
320+
.as_ref()
321+
.is_some_and(|p| p.marked().contains_key(&previously_selected_index)),
321322
"it marks the selected node"
322323
);
323324
assert_eq!(
@@ -355,9 +356,10 @@ fn simple_user_journey_read_only() -> Result<()> {
355356
);
356357

357358
assert!(
358-
app.window.mark_pane.as_ref().map_or(false, |p| p
359-
.marked()
360-
.contains_key(&previously_selected_index)),
359+
app.window
360+
.mark_pane
361+
.as_ref()
362+
.is_some_and(|p| p.marked().contains_key(&previously_selected_index)),
361363
"it leaves the first selected item marked"
362364
);
363365
}

src/interactive/widgets/glob.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl GlobPane {
7474
self.input
7575
.graphemes(true)
7676
.take(self.cursor_grapheme_idx)
77-
.map(|g| g.as_bytes().len())
77+
.map(|g| g.len())
7878
.sum::<usize>(),
7979
new_char,
8080
);

src/traverse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ impl BackgroundTraversal {
387387
}
388388
}
389389

390-
if self.throttle.as_ref().map_or(false, |t| t.can_update()) {
390+
if self.throttle.as_ref().is_some_and(|t| t.can_update()) {
391391
return Some(false);
392392
}
393393
}

0 commit comments

Comments
 (0)