diff options
| author | Austin Hellyer <[email protected]> | 2017-02-01 17:38:18 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2017-02-01 17:38:18 -0800 |
| commit | 97f9bd10c16eb24d54a0ab00c52f19eb51a88675 (patch) | |
| tree | 46d7e2ce70553917f42efa6506f01b70739b0d81 /src/ext/framework | |
| parent | Optimize presence update for self in cache (diff) | |
| download | serenity-97f9bd10c16eb24d54a0ab00c52f19eb51a88675.tar.xz serenity-97f9bd10c16eb24d54a0ab00c52f19eb51a88675.zip | |
Fix unreachable patterns in command macro
When attempting to use a named argument with a type of String, the
framework will try to parse the received argument - a String - into a
String. This can never fail, so Rust warns that the `Err` arm of the
`match` can never be reached.
Let's just ignore that and everything will be fine.
Diffstat (limited to 'src/ext/framework')
| -rw-r--r-- | src/ext/framework/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ext/framework/mod.rs b/src/ext/framework/mod.rs index e2a4479..76f3418 100644 --- a/src/ext/framework/mod.rs +++ b/src/ext/framework/mod.rs @@ -140,7 +140,7 @@ macro_rules! command { } }; ($fname:ident($c:ident, $m:ident, $a:ident, $($name:ident: $t:ty),*) $b:block) => { - #[allow(unused_mut)] + #[allow(unreachable_patterns, unused_mut)] pub fn $fname(mut $c: &mut $crate::client::Context, $m: &$crate::model::Message, $a: Vec<String>) -> ::std::result::Result<(), String> { let mut i = $a.iter(); let mut arg_counter = 0; |