From cfbd0be692dfe3cd687fb75322cf0fd4c4373237 Mon Sep 17 00:00:00 2001 From: Brian Dashore Date: Thu, 20 Aug 2020 17:25:31 -0400 Subject: [PATCH] Abstract CommandResult type (#934) CommandResult currently hardcodes to returning a Result with type (). Doing this limits the usability of CommandResult since users can't use this type alias with functions that return Results that don't use type (). Since Rust has type defaults, abstract CommandResult to accept type T with a default type of () which doesn't compromise the existing usage of CommandResult, but adds onto it. Signed-off-by: kingbri --- src/framework/standard/structures/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/framework/standard/structures/mod.rs b/src/framework/standard/structures/mod.rs index 5a320b3305a..27f84047701 100644 --- a/src/framework/standard/structures/mod.rs +++ b/src/framework/standard/structures/mod.rs @@ -70,7 +70,7 @@ pub struct CommandOptions { } pub type CommandError = Box; -pub type CommandResult = std::result::Result<(), CommandError>; +pub type CommandResult = std::result::Result; pub type CommandFn = for<'fut> fn(&'fut Context, &'fut Message, Args) -> BoxFuture<'fut, CommandResult>; pub struct Command {