Skip to content

Commit 39f274c

Browse files
committed
new lint fixes
using stable rust v1.87 produces new clippy fixes.
1 parent 17134fb commit 39f274c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cpp-linter/src/common_fs/file_filter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ impl FileFilter {
6161
for line in read_buf.split('\n') {
6262
if line.trim_start().starts_with("path") {
6363
assert!(line.find('=').unwrap() > 0);
64-
let submodule = String::from("./") + line.split('=').last().unwrap().trim();
64+
let submodule =
65+
String::from("./") + line.split('=').next_back().unwrap().trim();
6566
log::debug!("Found submodule: {submodule}");
6667
let mut is_ignored = true;
6768
for pat in &self.not_ignored {
@@ -159,7 +160,7 @@ impl FileFilter {
159160
let mut is_hidden = false;
160161
let parent = path
161162
.components()
162-
.last()
163+
.next_back()
163164
.ok_or(anyhow!("parent directory not known for {path:?}"))?;
164165
if parent.as_os_str().to_str().unwrap().starts_with('.') {
165166
is_hidden = true;

0 commit comments

Comments
 (0)