use ryo_source::pure::PureStmt;
use ryo_symbol::SymbolId;
use crate::Mutation;
#[derive(Debug, Clone)]
pub struct ReplaceStatementMutation {
pub old_stmt: PureStmt,
pub new_stmt: PureStmt,
pub target_fn: SymbolId,
}
impl ReplaceStatementMutation {
pub fn new(old_stmt: PureStmt, new_stmt: PureStmt, target_fn: SymbolId) -> Self {
Self {
old_stmt,
new_stmt,
target_fn,
}
}
}
impl Mutation for ReplaceStatementMutation {
fn describe(&self) -> String {
"Replace statement with another statement".to_string()
}
fn mutation_type(&self) -> &'static str {
"ReplaceStatement"
}
fn box_clone(&self) -> Box<dyn Mutation> {
Box::new(self.clone())
}
}