From 48408e8963ad8687697373cb6694e8e105ce61d3 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Tue, 5 May 2020 21:33:30 +0800 Subject: [PATCH] ref --- regex/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regex/src/main.rs b/regex/src/main.rs index 87cfc22..73ec91b 100644 --- a/regex/src/main.rs +++ b/regex/src/main.rs @@ -18,7 +18,7 @@ fn main() { let re2 = Regex::new(r"(\d+)").unwrap(); println!("{}", re2.replace_all("Hello 100, 200", | caps: ®ex::Captures | { - "(".to_owned() + &caps[1] + ")" + "(".to_owned() + &(caps[1].parse::().unwrap() * 2).to_string() + ")" })); println!("{}", re2.replace_all("Hello 100, 200", | caps: ®ex::Captures<'_> | { "[".to_owned() + &caps[1] + "]"