diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-10-16 11:18:04 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-10-16 11:18:04 +0300 |
commit | d5f5f90f7e38e575bba148a510a27c853777e430 (patch) | |
tree | e4a3ad0f61e5307419e6fe0197a0e5ff694c6555 | |
parent | d2f45338e4731d5d81d4fcd8c6f7e2ae260898db (diff) | |
download | riki-d5f5f90f7e38e575bba148a510a27c853777e430.tar.gz |
style: drop an unnecessary temporary variable
Sponsored-by: author
-rw-r--r-- | src/pagespec.rs | 7 |
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; } |