From 0d6965f647396c84b2570e92b63244c3afaea863 Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Sat, 29 Jul 2017 22:53:50 +0200 Subject: Remove a few clones --- src/framework/command.rs | 8 ++++---- src/framework/mod.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/framework') diff --git a/src/framework/command.rs b/src/framework/command.rs index 4e338d4..19b6756 100644 --- a/src/framework/command.rs +++ b/src/framework/command.rs @@ -104,15 +104,15 @@ pub fn positions(ctx: &mut Context, msg: &Message, conf: &Configuration) -> Opti positions.push(x.len()); } } else { - for n in conf.prefixes.clone() { - if msg.content.starts_with(&n) { + for n in &conf.prefixes { + if msg.content.starts_with(n) { positions.push(n.len()); } } } } else { - for n in conf.prefixes.clone() { - if msg.content.starts_with(&n) { + for n in &conf.prefixes { + if msg.content.starts_with(n) { positions.push(n.len()); } } diff --git a/src/framework/mod.rs b/src/framework/mod.rs index 14533b5..ccebfd4 100644 --- a/src/framework/mod.rs +++ b/src/framework/mod.rs @@ -682,7 +682,7 @@ impl BuiltinFramework { if let Some(ref prefix) = group.prefix { for v in &cmd.aliases { group.commands.insert( - format!("{} {}", prefix, v.to_owned()), + format!("{} {}", prefix, v), CommandOrAlias::Alias(format!("{} {}", prefix, name)), ); } -- cgit v1.2.3