diff options
| author | Austin Hellyer <[email protected]> | 2016-12-09 17:09:05 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-12-09 17:09:05 -0800 |
| commit | 51c97224b53693ffe9bddf0cf81c31a2c9b29bbb (patch) | |
| tree | 729294ecbdeb315e01add55ab402804747f998b0 /src/utils/mod.rs | |
| parent | Add installation notes (diff) | |
| download | serenity-51c97224b53693ffe9bddf0cf81c31a2c9b29bbb.tar.xz serenity-51c97224b53693ffe9bddf0cf81c31a2c9b29bbb.zip | |
Abstract command fields to types
Diffstat (limited to 'src/utils/mod.rs')
| -rw-r--r-- | src/utils/mod.rs | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs index fbc642f..f0e4d3a 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -218,23 +218,21 @@ pub fn parse_quotes(s: &str) -> Vec<String> { } else { current_str.push(x); } - } else { - if x == ' ' { - if !current_str.is_empty() { - args.push(current_str.clone()); - } - - current_str = String::default(); - } else if x == '"' { - if !current_str.is_empty() { - args.push(current_str.clone()); - } + } else if x == ' ' { + if !current_str.is_empty() { + args.push(current_str.clone()); + } - in_string = true; - current_str = String::default(); - } else { - current_str.push(x); + current_str = String::default(); + } else if x == '"' { + if !current_str.is_empty() { + args.push(current_str.clone()); } + + in_string = true; + current_str = String::default(); + } else { + current_str.push(x); } } |