summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-10-16 11:18:04 +0300
committerLars Wirzenius <liw@liw.fi>2022-10-16 11:18:04 +0300
commitd5f5f90f7e38e575bba148a510a27c853777e430 (patch)
treee4a3ad0f61e5307419e6fe0197a0e5ff694c6555
parentd2f45338e4731d5d81d4fcd8c6f7e2ae260898db (diff)
downloadriki-d5f5f90f7e38e575bba148a510a27c853777e430.tar.gz
style: drop an unnecessary temporary variable
Sponsored-by: author
-rw-r--r--src/pagespec.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pagespec.rs b/src/pagespec.rs
index de365a9..199e7f3 100644
--- a/src/pagespec.rs
+++ b/src/pagespec.rs
@@ -100,12 +100,11 @@ fn glob_matches_helper(mut glob: &[char], mut path: &[char]) -> bool {
if glob_remain.is_empty() {
return true;
}
- let mut path_remain = &path[..];
- while !path_remain.is_empty() {
- if glob_matches_helper(&glob[1..], path_remain) {
+ while !path.is_empty() {
+ if glob_matches_helper(&glob[1..], path) {
return true;
}
- path_remain = &path_remain[1..];
+ path = &path[1..];
}
return false;
}