Skip to content

Commit 79d3691

Browse files
committed
Bump to 0.2.9
1 parent ac4250c commit 79d3691

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "glob"
4-
version = "0.2.8"
4+
version = "0.2.9"
55
authors = ["The Rust Project Developers"]
66
license = "MIT/Apache-2.0"
77
homepage = "https://github.com/rust-lang/glob"

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl Iterator for Paths {
258258
if let Some(scope) = self.scope.take() {
259259
if self.dir_patterns.len() > 0 {
260260
// Shouldn't happen, but we're using -1 as a special index.
261-
assert!(self.dir_patterns.len() < -1 as usize);
261+
assert!(self.dir_patterns.len() < !0 as usize);
262262

263263
fill_todo(&mut self.todo, &self.dir_patterns,
264264
0, &scope, &self.options);
@@ -277,7 +277,7 @@ impl Iterator for Paths {
277277

278278
// idx -1: was already checked by fill_todo, maybe path was '.' or
279279
// '..' that we can't match here because of normalization.
280-
if idx == -1 as usize {
280+
if idx == !0 as usize {
281281
if self.require_dir && !is_dir(&path) { continue; }
282282
return Some(Ok(path));
283283
}
@@ -415,7 +415,7 @@ enum CharSpecifier {
415415
CharRange(char, char)
416416
}
417417

418-
#[derive(Copy, PartialEq)]
418+
#[derive(Copy, Clone, PartialEq)]
419419
enum MatchResult {
420420
Match,
421421
SubPatternDoesntMatch,
@@ -729,7 +729,7 @@ fn fill_todo(todo: &mut Vec<Result<(PathBuf, usize), GlobError>>,
729729
// We know it's good, so don't make the iterator match this path
730730
// against the pattern again. In particular, it can't match
731731
// . or .. globs since these never show up as path components.
732-
todo.push(Ok((next_path, -1 as usize)));
732+
todo.push(Ok((next_path, !0 as usize)));
733733
} else {
734734
fill_todo(todo, patterns, idx + 1, &next_path, options);
735735
}

0 commit comments

Comments
 (0)