aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-12-14 09:24:55 -0800
committerAustin Hellyer <[email protected]>2016-12-14 09:24:55 -0800
commit5a3665a9951c023e3e6ea688844558b7f8b5fb6e (patch)
tree80924eb4b348e11f5a0678291a9e620be7db5846
parentSlightly rework framework buckets (diff)
downloadserenity-5a3665a9951c023e3e6ea688844558b7f8b5fb6e.tar.xz
serenity-5a3665a9951c023e3e6ea688844558b7f8b5fb6e.zip
Framework requires cache
-rw-r--r--Cargo.toml2
-rw-r--r--examples/06_command_framework/src/main.rs7
2 files changed, 4 insertions, 5 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 7fa498f..b5964f0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -49,6 +49,6 @@ yaml-rust = "0.3"
default = ["cache", "framework", "methods"]
cache = []
debug = []
-framework = []
+framework = ["cache"]
methods = []
voice = ["opus", "sodiumoxide"]
diff --git a/examples/06_command_framework/src/main.rs b/examples/06_command_framework/src/main.rs
index 494a453..e89308f 100644
--- a/examples/06_command_framework/src/main.rs
+++ b/examples/06_command_framework/src/main.rs
@@ -84,10 +84,9 @@ fn main() {
// Very similar to `before`, except this will be called directly _after_
// command execution.
.after(|_, _, command_name, error| {
- if let Some(why) = error {
- println!("Command '{}' returned error {:?}", command_name, why);
- } else {
- println!("Processed command '{}'", command_name);
+ match error {
+ Ok(()) => println!("Processed command '{}'", command_name),
+ Err(why) => println!("Command '{}' returned error {:?}", command_name, why),
}
})
// Can't be used more than once per 5 seconds: