pub struct ReplaceMatchArmMutation {
pub function_id: SymbolId,
pub enum_name: String,
pub old_pattern: String,
pub new_pattern: String,
pub new_body: String,
}Expand description
Replace a match arm (pattern + body) in an existing match expression
This mutation allows replacing both the pattern and body of a match arm atomically, solving the issue where ReplaceExpr only modifies the body but leaves the pattern unchanged.
Fields§
§function_id: SymbolIdTarget function SymbolId
enum_name: StringEnum name to identify the target match expression
old_pattern: StringPattern to match for replacement (e.g., “PathSegment::Slice { start: _, end: _ }”)
new_pattern: StringNew pattern string (e.g., “PathSegment::Slice { start, end }”)
new_body: StringNew body string (e.g., “{ /* implementation */ }”)
Implementations§
Trait Implementations§
Source§impl Clone for ReplaceMatchArmMutation
impl Clone for ReplaceMatchArmMutation
Source§fn clone(&self) -> ReplaceMatchArmMutation
fn clone(&self) -> ReplaceMatchArmMutation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReplaceMatchArmMutation
impl Debug for ReplaceMatchArmMutation
Source§impl Mutation for ReplaceMatchArmMutation
impl Mutation for ReplaceMatchArmMutation
Source§fn mutation_type(&self) -> &'static str
fn mutation_type(&self) -> &'static str
Get the mutation type name
Source§fn validate(&self, _file: &PureFile) -> ValidationResult
fn validate(&self, _file: &PureFile) -> ValidationResult
Validate the mutation before applying Read more
Source§fn can_proceed(&self, file: &PureFile, strategy: ValidationStrategy) -> bool
fn can_proceed(&self, file: &PureFile, strategy: ValidationStrategy) -> bool
Check if this mutation can proceed with the given strategy
Source§impl ToSerializable for ReplaceMatchArmMutation
impl ToSerializable for ReplaceMatchArmMutation
fn to_serializable(&self) -> SerializableMutation
Auto Trait Implementations§
impl Freeze for ReplaceMatchArmMutation
impl RefUnwindSafe for ReplaceMatchArmMutation
impl Send for ReplaceMatchArmMutation
impl Sync for ReplaceMatchArmMutation
impl Unpin for ReplaceMatchArmMutation
impl UnsafeUnpin for ReplaceMatchArmMutation
impl UnwindSafe for ReplaceMatchArmMutation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more