aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-12-09 17:09:05 -0800
committerAustin Hellyer <[email protected]>2016-12-09 17:09:05 -0800
commit51c97224b53693ffe9bddf0cf81c31a2c9b29bbb (patch)
tree729294ecbdeb315e01add55ab402804747f998b0 /src/utils
parentAdd installation notes (diff)
downloadserenity-51c97224b53693ffe9bddf0cf81c31a2c9b29bbb.tar.xz
serenity-51c97224b53693ffe9bddf0cf81c31a2c9b29bbb.zip
Abstract command fields to types
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs28
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);
}
}