2 Checks for functions of type `Result` that contain `expect()` or `unwrap()`
5 These functions promote recoverable errors to non-recoverable errors which may be undesirable in code bases which wish to avoid panics.
8 This can cause false positives in functions that handle both recoverable and non recoverable errors.
13 fn divisible_by_3(i_str: String) -> Result<(), String> {
16 .expect("cannot divide the input by three");
19 Err("Number is not divisible by 3")?
28 fn divisible_by_3(i_str: String) -> Result<(), String> {
31 .map_err(|e| format!("cannot divide the input by three: {}", e))?;
34 Err("Number is not divisible by 3")?