From e74e7e0d501afdfde6d75fc63a8abf36d329d2de Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Thu, 21 Jun 2018 19:19:25 +0200 Subject: Directly use the iterator --- src/framework/standard/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/framework') diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index c92e5ce..95fa074 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -979,14 +979,14 @@ impl Framework for StandardFramework { 'outer: for position in positions { let mut built = String::new(); let round = message.content.chars().skip(position).collect::(); - let round = round.trim().split_whitespace().collect::>(); // Call to `trim` causes the related bug under the main bug #206 - where the whitespace settings are ignored. The fix is implemented as an additional check inside command::positions + let mut round = round.trim().split_whitespace(); // Call to `trim` causes the related bug under the main bug #206 - where the whitespace settings are ignored. The fix is implemented as an additional check inside command::positions for i in 0..self.configuration.depth { if i != 0 { built.push(' '); } - built.push_str(match round.get(i) { + built.push_str(match round.next() { Some(piece) => piece, None => continue 'outer, }); -- cgit v1.2.3