ryo_mutations/basic/stmt/
replace_statement.rs1use ryo_source::pure::PureStmt;
12use ryo_symbol::SymbolId;
13
14use crate::Mutation;
15
16#[derive(Debug, Clone)]
18pub struct ReplaceStatementMutation {
19 pub old_stmt: PureStmt,
21 pub new_stmt: PureStmt,
23 pub target_fn: SymbolId,
25}
26
27impl ReplaceStatementMutation {
28 pub fn new(old_stmt: PureStmt, new_stmt: PureStmt, target_fn: SymbolId) -> Self {
29 Self {
30 old_stmt,
31 new_stmt,
32 target_fn,
33 }
34 }
35}
36
37impl Mutation for ReplaceStatementMutation {
38 fn describe(&self) -> String {
39 "Replace statement with another statement".to_string()
40 }
41
42 fn mutation_type(&self) -> &'static str {
43 "ReplaceStatement"
44 }
45
46 fn box_clone(&self) -> Box<dyn Mutation> {
47 Box::new(self.clone())
48 }
49}