]> git.lizzy.rs Git - rust.git/blobdiff - clippy_utils/src/lib.rs
Fix `option_if_let_else`
[rust.git] / clippy_utils / src / lib.rs
index bd229402f418203b67e9845c5617450566d6043f..bb7de1653602ec4de20b1c0869a80cd9d9764f1a 100644 (file)
@@ -709,6 +709,11 @@ pub enum CaptureKind {
     Value,
     Ref(Mutability),
 }
+impl CaptureKind {
+    pub fn is_imm_ref(self) -> bool {
+        self == Self::Ref(Mutability::Not)
+    }
+}
 impl std::ops::BitOr for CaptureKind {
     type Output = Self;
     fn bitor(self, rhs: Self) -> Self::Output {