diff options
| author | acdenisSK <[email protected]> | 2018-06-21 00:03:36 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2018-06-21 00:03:36 +0200 |
| commit | 1ec1086026971c903858128a8d38c5143f3f0f6f (patch) | |
| tree | e135eb3028fa51bd538abfbdd204b5589f25d49a /src/framework | |
| parent | Remove slight repetition (diff) | |
| download | serenity-1ec1086026971c903858128a8d38c5143f3f0f6f.tar.xz serenity-1ec1086026971c903858128a8d38c5143f3f0f6f.zip | |
And another (function call) repetion
Diffstat (limited to 'src/framework')
| -rw-r--r-- | src/framework/standard/command.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/framework/standard/command.rs b/src/framework/standard/command.rs index c587733..f88d2de 100644 --- a/src/framework/standard/command.rs +++ b/src/framework/standard/command.rs @@ -359,9 +359,11 @@ pub fn positions(ctx: &mut Context, msg: &Message, conf: &Configuration) -> Opti let pos = *unsafe { positions.get_unchecked(0) }; + let with_whitespace = find_end_of_prefix_with_whitespace(&msg.content, pos); + if conf.allow_whitespace { - positions.insert(0, find_end_of_prefix_with_whitespace(&msg.content, pos).unwrap_or(pos)); - } else if find_end_of_prefix_with_whitespace(&msg.content, pos).is_some() { + positions.insert(0, with_whitespace.unwrap_or(pos)); + } else if with_whitespace.is_some() { return None; } |