X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=clippy_utils%2Fsrc%2Fsugg.rs;h=5b0efb1fd7132811c449eb408729f4ea08f40870;hb=b9d753e4f5eb921a4185d5bbaef15a5af2c43e2f;hp=65d93e8f86e43f1c7953d83f45721bb9add27c43;hpb=72df99a49b565c5e35264f8efb868d5e30f1be02;p=rust.git diff --git a/clippy_utils/src/sugg.rs b/clippy_utils/src/sugg.rs index 65d93e8f86e..5b0efb1fd71 100644 --- a/clippy_utils/src/sugg.rs +++ b/clippy_utils/src/sugg.rs @@ -311,7 +311,7 @@ pub fn maybe_par(self) -> Self { /// Return `true` if `sugg` is enclosed in parenthesis. fn has_enclosing_paren(sugg: impl AsRef) -> bool { let mut chars = sugg.as_ref().chars(); - if let Some('(') = chars.next() { + if chars.next() == Some('(') { let mut depth = 1; for c in &mut chars { if c == '(' { @@ -329,7 +329,7 @@ fn has_enclosing_paren(sugg: impl AsRef) -> bool { } } -// Copied from the rust standart library, and then edited +/// Copied from the rust standard library, and then edited macro_rules! forward_binop_impls_to_ref { (impl $imp:ident, $method:ident for $t:ty, type Output = $o:ty) => { impl $imp<$t> for &$t {