[refurb] Add fix safety section (FURB105) (#17499)
## Summary This PR add the `fix safety` section for rule `FURB105` in `print_empty_string.rs` for #15584 Before: ``` def get_sep(): print("side effect") return "" print("", sep=get_sep()) ``` After: ``` def get_sep(): print("side effect") return "" print() ``` --------- Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
This commit is contained in:
@@ -30,6 +30,11 @@ use crate::{Applicability, Edit, Fix, FixAvailability, Violation};
|
||||
/// print()
|
||||
/// ```
|
||||
///
|
||||
/// ## Fix safety
|
||||
/// This fix is marked as unsafe if it removes an unused `sep` keyword argument
|
||||
/// that may have side effects. Removing such arguments may change the program's
|
||||
/// behavior by skipping the execution of those side effects.
|
||||
///
|
||||
/// ## References
|
||||
/// - [Python documentation: `print`](https://docs.python.org/3/library/functions.html#print)
|
||||
#[derive(ViolationMetadata)]
|
||||
|
||||
Reference in New Issue
Block a user