diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-05-12 21:36:30 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-05-14 18:29:12 -0700 |
| commit | 30dbcf5f88b20db3ea1c70bb50cb37fa9364f1a9 (patch) | |
| tree | 5246c3a724ad1b40d779c273b4b0e1482a65fbd9 /src | |
| parent | 8a1aaac396cea58a9192cbcab3bb87522ceba907 (diff) | |
| download | rust-30dbcf5f88b20db3ea1c70bb50cb37fa9364f1a9.tar.gz rust-30dbcf5f88b20db3ea1c70bb50cb37fa9364f1a9.zip | |
libglob: Remove all uses of `~str` from `libglob`
Diffstat (limited to 'src')
| -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 cd6b61049e0..7b9260c7eb9 100644 --- a/src/libglob/lib.rs +++ b/src/libglob/lib.rs @@ -310,7 +310,7 @@ impl Pattern { * brackets. The resulting string will, when compiled into a `Pattern`, * match the input string and nothing else. */ - pub fn escape(s: &str) -> ~str { + pub fn escape(s: &str) -> StrBuf { let mut escaped = StrBuf::new(); for c in s.chars() { match c { @@ -325,7 +325,7 @@ impl Pattern { } } } - escaped.into_owned() + escaped } /** @@ -767,8 +767,8 @@ mod test { #[test] fn test_pattern_escape() { let s = "_[_]_?_*_!_"; - assert_eq!(Pattern::escape(s), "_[[]_[]]_[?]_[*]_!_".to_owned()); - assert!(Pattern::new(Pattern::escape(s)).matches(s)); + assert_eq!(Pattern::escape(s), "_[[]_[]]_[?]_[*]_!_".to_strbuf()); + assert!(Pattern::new(Pattern::escape(s).as_slice()).matches(s)); } #[test] |
