On Mon, Oct 20, 2014 at 3:57 PM, Jake Scott <[email protected]> wrote:
> fn clean<'a>(number: &'a str) -> &'a str {
> if ALPHA_REGEX.is_match(number) {
> "0000000000";
> }
> let clean_number: String = NUMBER_REGEX.replace(number, "");
> return clean_number.as_slice();
> }
FYI, this doesn't do what you think it does. "0000000000"; just
throws away a string - I don't know why the warning for it isn't
enabled by default. You could either use "return" or change it to
if/else:
if ALPHA_REGEX.is_match(number) {
"0000000000" // no semicolon
} else {
...
}
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev