1 #![warn(clippy::panic_in_result_fn)]
2 #![allow(clippy::unnecessary_wraps)]
4 // debug_assert should never trigger the `panic_in_result_fn` lint
9 fn result_with_debug_assert_with_message(x: i32) -> Result<bool, String> {
10 debug_assert!(x == 5, "wrong argument");
14 fn result_with_debug_assert_eq(x: i32) -> Result<bool, String> {
15 debug_assert_eq!(x, 5);
19 fn result_with_debug_assert_ne(x: i32) -> Result<bool, String> {
20 debug_assert_ne!(x, 1);
24 fn other_with_debug_assert_with_message(x: i32) {
25 debug_assert!(x == 5, "wrong argument");
28 fn other_with_debug_assert_eq(x: i32) {
29 debug_assert_eq!(x, 5);
32 fn other_with_debug_assert_ne(x: i32) {
33 debug_assert_ne!(x, 1);
36 fn result_without_banned_functions() -> Result<bool, String> {
37 let debug_assert = "debug_assert!";
38 println!("No {}", debug_assert);