Skip to content

Commit b257d5f

Browse files
committed
Remove useless as usize
1 parent 21962b9 commit b257d5f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl Iterator for Paths {
342342
if let Some(scope) = self.scope.take() {
343343
if !self.dir_patterns.is_empty() {
344344
// Shouldn't happen, but we're using -1 as a special index.
345-
assert!(self.dir_patterns.len() < !0 as usize);
345+
assert!(self.dir_patterns.len() < !0);
346346

347347
fill_todo(&mut self.todo, &self.dir_patterns, 0, &scope, self.options);
348348
}
@@ -360,7 +360,7 @@ impl Iterator for Paths {
360360

361361
// idx -1: was already checked by fill_todo, maybe path was '.' or
362362
// '..' that we can't match here because of normalization.
363-
if idx == !0 as usize {
363+
if idx == !0 {
364364
if self.require_dir && !is_dir(&path) {
365365
continue;
366366
}
@@ -839,7 +839,7 @@ fn fill_todo(
839839
// We know it's good, so don't make the iterator match this path
840840
// against the pattern again. In particular, it can't match
841841
// . or .. globs since these never show up as path components.
842-
todo.push(Ok((next_path, !0 as usize)));
842+
todo.push(Ok((next_path, !0)));
843843
} else {
844844
fill_todo(todo, patterns, idx + 1, &next_path, options);
845845
}

tests/glob-std.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ fn main() {
4949
}
5050

5151
fn glob_with_vec(pattern: &str, options: glob::MatchOptions) -> Vec<PathBuf> {
52-
glob_with(pattern, options).unwrap().map(|r| r.unwrap()).collect()
52+
glob_with(pattern, options)
53+
.unwrap()
54+
.map(|r| r.unwrap())
55+
.collect()
5356
}
5457

5558
let root = TempDir::new("glob-tests");

0 commit comments

Comments
 (0)