From e5889ed1a62ddcb6bc11364800cd813329eb3ece Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Sat, 12 Aug 2017 20:38:35 +0200 Subject: Trim a second time for a sake --- src/framework/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/framework') diff --git a/src/framework/mod.rs b/src/framework/mod.rs index d55c26d..ba80e60 100644 --- a/src/framework/mod.rs +++ b/src/framework/mod.rs @@ -931,17 +931,19 @@ impl ::Framework for BuiltinFramework { let groups = self.groups.clone(); let args = { - let content = message.content[position..].trim(); + let mut content = message.content[position..].trim(); + content = content[command_length..].trim(); if command.use_quotes { utils::parse_quotes(&content[command_length..]) } else { - let delimeter = { - let delimeter = self.configuration.delimeters.iter().find(|d| content[command_length..].contains(d.as_str())); - delimeter.map(|s| s.as_str()).unwrap_or(" ") - }; + let delimeter = self.configuration.delimeters + .iter() + .find(|d| content.contains(d.as_str())) + .map(|s| s.as_str()) + .unwrap_or(" "); - content[command_length..] + content .split(delimeter) .map(|arg| arg.to_owned()) .collect::>() -- cgit v1.2.3