clippy: Resolve if_same_then_else

Suppressing the lint locally because by the author's and reviewers'
judgement this was the clearest way to write this code. The lint is
still valuable for catching mistakes in copied and pasted code
elsewhere.

TEST=bin/clippy

Change-Id: I77477fce51571220fd6259072519b31764a15aeb
Reviewed-on: https://chromium-review.googlesource.com/1566737
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
David Tolnay 2019-04-12 18:14:48 -07:00 committed by chrome-bot
parent e246836798
commit afb1401500
3 changed files with 2 additions and 1 deletions

View file

@ -39,7 +39,6 @@ SUPPRESS=(
# To be resolved or suppressed locally.
cast_ptr_alignment
if_same_then_else
ptr_arg
# We don't care about these lints. Okay to remain suppressed globally.

View file

@ -111,6 +111,7 @@ impl<'a> DescriptorChain<'a> {
}
}
#[allow(clippy::if_same_then_else)]
fn is_valid(&self) -> bool {
if self
.mem

View file

@ -165,6 +165,7 @@ pub trait Vhost: AsRawFd + std::marker::Sized {
}
// TODO(smbarber): This is copypasta. Eliminate the copypasta.
#[allow(clippy::if_same_then_else)]
fn is_valid(
&self,
queue_max_size: u16,