apply clippy suggestions

pull/10391/head
metafates 7 months ago
parent b792676400
commit ddc48d4d66

@ -1640,7 +1640,7 @@ fn get_ids_of_duplicate_paths(
} }
fn adjust_paths_levels(levels: &mut HashMap<DocumentId, LevelledPathBuf>) { fn adjust_paths_levels(levels: &mut HashMap<DocumentId, LevelledPathBuf>) {
while let Some(duplicates) = get_ids_of_duplicate_paths(&levels) { while let Some(duplicates) = get_ids_of_duplicate_paths(levels) {
for id in duplicates { for id in duplicates {
if let Some(level) = levels.get_mut(&id) { if let Some(level) = levels.get_mut(&id) {
level.increment() level.increment()
@ -1655,10 +1655,9 @@ fn build_bufferline_paths(editor: &Editor) -> HashMap<DocumentId, LevelledPathBu
.filter_map(|d| { .filter_map(|d| {
if let Some(path) = d.relative_path() { if let Some(path) = d.relative_path() {
Some((d.id(), LevelledPathBuf::new(path.to_path_buf()))) Some((d.id(), LevelledPathBuf::new(path.to_path_buf())))
} else if let Some(path) = d.path() {
Some((d.id(), LevelledPathBuf::new(path.to_owned())))
} else { } else {
None d.path()
.map(|p| (d.id(), LevelledPathBuf::new(p.to_owned())))
} }
}) })
.collect(); .collect();

Loading…
Cancel
Save