Skip to content

Commit

Permalink
Use slice::first() instead of slice::get(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Nov 12, 2023
1 parent a664584 commit 06b31cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/loaders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub struct Entry {
}

fn common_prefix(entries: &[Entry]) -> Option<String> {
let first = &entries.get(0)?.designator;
let first = &entries.first()?.designator;
for (i, _) in first.rmatch_indices('/') {
let prefix = &first[0..=i];
if entries
Expand Down

0 comments on commit 06b31cd

Please sign in to comment.