diff options
| author | acdenisSK <[email protected]> | 2017-08-14 22:26:21 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-08-14 22:26:21 +0200 |
| commit | e00fe3ad9e1853443c8905da934ea3983813af89 (patch) | |
| tree | 2945905905b56526ec088966ca1db6732f46d0a0 /examples/05_command_framework/src | |
| parent | `$crate_name` => `version`, and a few adjustements (diff) | |
| download | serenity-e00fe3ad9e1853443c8905da934ea3983813af89.tar.xz serenity-e00fe3ad9e1853443c8905da934ea3983813af89.zip | |
Update examples
Diffstat (limited to 'examples/05_command_framework/src')
| -rw-r--r-- | examples/05_command_framework/src/main.rs | 6 |
1 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 467c4ab..c6c0fe4 100644 --- a/examples/05_command_framework/src/main.rs +++ b/examples/05_command_framework/src/main.rs @@ -42,7 +42,7 @@ fn main() { let mut client = Client::new(&token, Handler); { - let mut data = client.data.lock().unwrap(); + let mut data = client.data.lock(); data.insert::<CommandCounter>(HashMap::default()); } @@ -80,7 +80,7 @@ fn main() { // Increment the number of times this command has been run once. If // the command's name does not exist in the counter, add a default // value of 0. - let mut data = ctx.data.lock().unwrap(); + let mut data = ctx.data.lock(); let counter = data.get_mut::<CommandCounter>().unwrap(); let entry = counter.entry(command_name.clone()).or_insert(0); *entry += 1; @@ -148,7 +148,7 @@ fn main() { command!(commands(ctx, msg, _args) { let mut contents = "Commands used:\n".to_owned(); - let data = ctx.data.lock().unwrap(); + let data = ctx.data.lock(); let counter = data.get::<CommandCounter>().unwrap(); for (k, v) in counter { |