aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-10-01 21:59:33 +0200
committerZeyla Hellyer <[email protected]>2017-10-09 15:46:37 -0700
commit0ce8be869eeb2eb700e22f71b2e00872cc96a500 (patch)
tree03dd981bc04ba8475333d057705820c3320e3a97 /examples
parentHave `ConnectionStage` derive Copy (diff)
downloadserenity-0ce8be869eeb2eb700e22f71b2e00872cc96a500.tar.xz
serenity-0ce8be869eeb2eb700e22f71b2e00872cc96a500.zip
`to_owned` -> `to_string`
Diffstat (limited to 'examples')
-rw-r--r--examples/05_command_framework/src/main.rs4
-rw-r--r--examples/07_sample_bot_structure/src/commands/meta.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/05_command_framework/src/main.rs b/examples/05_command_framework/src/main.rs
index e68f9d2..437c44e 100644
--- a/examples/05_command_framework/src/main.rs
+++ b/examples/05_command_framework/src/main.rs
@@ -94,7 +94,7 @@ fn main() {
// value of 0.
let mut data = ctx.data.lock();
let counter = data.get_mut::<CommandCounter>().unwrap();
- let entry = counter.entry(command_name.to_owned()).or_insert(0);
+ let entry = counter.entry(command_name.to_string()).or_insert(0);
*entry += 1;
true // if `before` returns false, command processing doesn't happen.
@@ -163,7 +163,7 @@ fn main() {
// "multiply" command below for some of the power that the `command!` macro can
// bring.
command!(commands(ctx, msg, _args) {
- let mut contents = "Commands used:\n".to_owned();
+ let mut contents = "Commands used:\n".to_string();
let data = ctx.data.lock();
let counter = data.get::<CommandCounter>().unwrap();
diff --git a/examples/07_sample_bot_structure/src/commands/meta.rs b/examples/07_sample_bot_structure/src/commands/meta.rs
index 4b43cb8..18ee48d 100644
--- a/examples/07_sample_bot_structure/src/commands/meta.rs
+++ b/examples/07_sample_bot_structure/src/commands/meta.rs
@@ -1,7 +1,7 @@
command!(latency(ctx, msg) {
let latency = ctx.shard.lock()
.latency()
- .map_or_else(|| "N/A".to_owned(), |s| {
+ .map_or_else(|| "N/A".to_string(), |s| {
format!("{}.{}s", s.as_secs(), s.subsec_nanos())
});