diff --git a/src/analysis/function_parameters.rs b/src/analysis/function_parameters.rs index 6f50866f0..6b6849c7f 100644 --- a/src/analysis/function_parameters.rs +++ b/src/analysis/function_parameters.rs @@ -240,7 +240,12 @@ pub fn analyze( } }; - if async_func && to_remove.contains(&(pos - correction_instance)) { + if async_func + && pos + .checked_sub(correction_instance) + .map(|p| to_remove.contains(&p)) + .unwrap_or(false) + { add_rust_parameter = false; } let mut transfer = par.transfer; diff --git a/src/analysis/functions.rs b/src/analysis/functions.rs index 62313bea1..4902207fe 100644 --- a/src/analysis/functions.rs +++ b/src/analysis/functions.rs @@ -735,7 +735,12 @@ fn analyze_function( correction_instance = 1; } - if r#async && to_remove.contains(&(pos - correction_instance)) { + if r#async + && pos + .checked_sub(correction_instance) + .map(|p| to_remove.contains(&p)) + .unwrap_or(false) + { continue; } assert!(