]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/comparison_chain.rs
Rollup merge of #102581 - jyn514:src-detection, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / comparison_chain.rs
index 3b03f8c7dfe7c71f6642646d2543a719ce3cbb4f..c12c6a310275db9c77d39849235c02058c5ee4bb 100644 (file)
@@ -203,4 +203,32 @@ fn same_operation_not_equals() {
     }
 }
 
+enum Sign {
+    Negative,
+    Positive,
+    Zero,
+}
+
+impl Sign {
+    const fn sign_i8(n: i8) -> Self {
+        if n == 0 {
+            Sign::Zero
+        } else if n > 0 {
+            Sign::Positive
+        } else {
+            Sign::Negative
+        }
+    }
+}
+
+const fn sign_i8(n: i8) -> Sign {
+    if n == 0 {
+        Sign::Zero
+    } else if n > 0 {
+        Sign::Positive
+    } else {
+        Sign::Negative
+    }
+}
+
 fn main() {}