diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-04-10 20:55:34 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-04-11 10:55:30 +1000 |
| commit | def90f43e2df9968cda730a2a30cb7ccb9513002 (patch) | |
| tree | e6c5f1ab3a51699595d15ffc96216e42aef68be5 /src/libglob | |
| parent | d8e45ea7c054b4ad6fb82ec3a9fcf1736b4d7260 (diff) | |
| download | rust-def90f43e2df9968cda730a2a30cb7ccb9513002.tar.gz rust-def90f43e2df9968cda730a2a30cb7ccb9513002.zip | |
Fix tests. Add Vec<u8> conversion to StrBuf.
Diffstat (limited to 'src/libglob')
| -rw-r--r-- | src/libglob/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libglob/lib.rs b/src/libglob/lib.rs index e7661b26b76..3cad5bf8175 100644 --- a/src/libglob/lib.rs +++ b/src/libglob/lib.rs @@ -462,8 +462,8 @@ impl Pattern { fn fill_todo(todo: &mut Vec<(Path, uint)>, patterns: &[Pattern], idx: uint, path: &Path, options: MatchOptions) { // convert a pattern that's just many Char(_) to a string - fn pattern_as_str(pattern: &Pattern) -> Option<~str> { - let mut s = ~""; + fn pattern_as_str(pattern: &Pattern) -> Option<StrBuf> { + let mut s = StrBuf::new(); for token in pattern.tokens.iter() { match *token { Char(c) => s.push_char(c), @@ -493,8 +493,8 @@ fn fill_todo(todo: &mut Vec<(Path, uint)>, patterns: &[Pattern], idx: uint, path // continue. So instead of passing control back to the iterator, // we can just check for that one entry and potentially recurse // right away. - let special = "." == s || ".." == s; - let next_path = path.join(s); + let special = "." == s.as_slice() || ".." == s.as_slice(); + let next_path = path.join(s.as_slice()); if (special && path.is_dir()) || (!special && next_path.exists()) { add(todo, next_path); } |
