We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17134fb commit 39f274cCopy full SHA for 39f274c
cpp-linter/src/common_fs/file_filter.rs
@@ -61,7 +61,8 @@ impl FileFilter {
61
for line in read_buf.split('\n') {
62
if line.trim_start().starts_with("path") {
63
assert!(line.find('=').unwrap() > 0);
64
- let submodule = String::from("./") + line.split('=').last().unwrap().trim();
+ let submodule =
65
+ String::from("./") + line.split('=').next_back().unwrap().trim();
66
log::debug!("Found submodule: {submodule}");
67
let mut is_ignored = true;
68
for pat in &self.not_ignored {
@@ -159,7 +160,7 @@ impl FileFilter {
159
160
let mut is_hidden = false;
161
let parent = path
162
.components()
- .last()
163
+ .next_back()
164
.ok_or(anyhow!("parent directory not known for {path:?}"))?;
165
if parent.as_os_str().to_str().unwrap().starts_with('.') {
166
is_hidden = true;
0 commit comments