aboutsummaryrefslogtreecommitdiff
path: root/src/ext/framework
diff options
context:
space:
mode:
authorKen Swenson <[email protected]>2017-05-19 00:53:32 -0400
committerzeyla <[email protected]>2017-05-18 21:53:32 -0700
commiteb43b9c4a4e43a8e097ea71fdc7584c8108b52a3 (patch)
treed1390e40b3df0695d6fe675e6d3468e571ddf115 /src/ext/framework
parentRemove deprecated login_bot function from docs (diff)
downloadserenity-eb43b9c4a4e43a8e097ea71fdc7584c8108b52a3.tar.xz
serenity-eb43b9c4a4e43a8e097ea71fdc7584c8108b52a3.zip
Allow unreachable_code lint in command! macro
If a user returns at the end of a `command!` macro block, the library's return value will never be processed, as it's unreachable. Instead of warning for this, allow it.
Diffstat (limited to 'src/ext/framework')
-rw-r--r--src/ext/framework/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ext/framework/mod.rs b/src/ext/framework/mod.rs
index ffcb648..cde10b2 100644
--- a/src/ext/framework/mod.rs
+++ b/src/ext/framework/mod.rs
@@ -117,7 +117,7 @@ use ::model::Channel;
#[macro_export]
macro_rules! command {
($fname:ident($c:ident) $b:block) => {
- #[allow(unused_mut)]
+ #[allow(unreachable_code, unused_mut)]
pub fn $fname(mut $c: &mut $crate::client::Context, _: &$crate::model::Message, _: Vec<String>) -> ::std::result::Result<(), String> {
$b
@@ -125,7 +125,7 @@ macro_rules! command {
}
};
($fname:ident($c:ident, $m:ident) $b:block) => {
- #[allow(unused_mut)]
+ #[allow(unreachable_code, unused_mut)]
pub fn $fname(mut $c: &mut $crate::client::Context, $m: &$crate::model::Message, _: Vec<String>) -> ::std::result::Result<(), String> {
$b
@@ -133,7 +133,7 @@ macro_rules! command {
}
};
($fname:ident($c:ident, $m:ident, $a:ident) $b:block) => {
- #[allow(unused_mut)]
+ #[allow(unreachable_code, unused_mut)]
pub fn $fname(mut $c: &mut $crate::client::Context, $m: &$crate::model::Message, $a: Vec<String>) -> ::std::result::Result<(), String> {
$b
@@ -141,7 +141,7 @@ macro_rules! command {
}
};
($fname:ident($c:ident, $m:ident, $a:ident, $($name:ident: $t:ty),*) $b:block) => {
- #[allow(unreachable_patterns, unused_mut)]
+ #[allow(unreachable_code, 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;