Skip to content

Commit 74ad5ed

Browse files
committed
---
yaml --- r: 151669 b: refs/heads/try2 c: 30dbcf5 h: refs/heads/master i: 151667: 13dc3fb v: v3
1 parent 0a37675 commit 74ad5ed

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 8a1aaac396cea58a9192cbcab3bb87522ceba907
8+
refs/heads/try2: 30dbcf5f88b20db3ea1c70bb50cb37fa9364f1a9
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libglob/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl Pattern {
310310
* brackets. The resulting string will, when compiled into a `Pattern`,
311311
* match the input string and nothing else.
312312
*/
313-
pub fn escape(s: &str) -> ~str {
313+
pub fn escape(s: &str) -> StrBuf {
314314
let mut escaped = StrBuf::new();
315315
for c in s.chars() {
316316
match c {
@@ -325,7 +325,7 @@ impl Pattern {
325325
}
326326
}
327327
}
328-
escaped.into_owned()
328+
escaped
329329
}
330330

331331
/**
@@ -767,8 +767,8 @@ mod test {
767767
#[test]
768768
fn test_pattern_escape() {
769769
let s = "_[_]_?_*_!_";
770-
assert_eq!(Pattern::escape(s), "_[[]_[]]_[?]_[*]_!_".to_owned());
771-
assert!(Pattern::new(Pattern::escape(s)).matches(s));
770+
assert_eq!(Pattern::escape(s), "_[[]_[]]_[?]_[*]_!_".to_strbuf());
771+
assert!(Pattern::new(Pattern::escape(s).as_slice()).matches(s));
772772
}
773773

774774
#[test]

0 commit comments

Comments
 (0)