diff --git a/Cargo.toml b/Cargo.toml index 5f637fcaa52e..049f85134d64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ cargo-fmt = [] toml = "0.2.1" rustc-serialize = "0.3" unicode-segmentation = "1.0.0" -regex = "0.1" +regex = "0.2" term = "0.4" strings = "0.0.1" diff = "0.1" diff --git a/src/string.rs b/src/string.rs index d8b3711040c2..8f51b09b6cc0 100644 --- a/src/string.rs +++ b/src/string.rs @@ -32,7 +32,7 @@ pub struct StringFormat<'a> { // FIXME: simplify this! pub fn rewrite_string<'a>(orig: &str, fmt: &StringFormat<'a>) -> Option { // Strip line breaks. - let re = Regex::new(r"([^\\](\\\\)*)\\[\n\r][:space:]*").unwrap(); + let re = Regex::new(r"([^\\](\\\\)*)\\[\n\r][[:space:]]*").unwrap(); let stripped_str = re.replace_all(orig, "$1"); let graphemes = UnicodeSegmentation::graphemes(&*stripped_str, false).collect::>(); diff --git a/tests/system.rs b/tests/system.rs index b2537e80755b..257b1ec46bf9 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -300,8 +300,8 @@ fn read_significant_comments(file_name: &str) -> HashMap { .take_while(|line| line_regex.is_match(&line)) .filter_map(|line| { regex.captures_iter(&line).next().map(|capture| { - (capture.at(1).expect("Couldn't unwrap capture").to_owned(), - capture.at(2).expect("Couldn't unwrap capture").to_owned()) + (capture.get(1).expect("Couldn't unwrap capture").as_str().to_owned(), + capture.get(2).expect("Couldn't unwrap capture").as_str().to_owned()) }) }) .collect()