use crate::Mutation;
#[derive(Debug, Clone)]
pub struct AddUseMutation {
pub path: String, }
impl AddUseMutation {
pub fn new(path: impl Into<String>) -> Self {
Self { path: path.into() }
}
}
impl Mutation for AddUseMutation {
fn describe(&self) -> String {
format!("Add use {}", self.path)
}
fn mutation_type(&self) -> &'static str {
"AddUse"
}
fn box_clone(&self) -> Box<dyn Mutation> {
Box::new(self.clone())
}
}
#[derive(Debug, Clone)]
pub struct RemoveUseMutation {
pub path: String,
}
impl RemoveUseMutation {
pub fn new(path: impl Into<String>) -> Self {
Self { path: path.into() }
}
}
impl Mutation for RemoveUseMutation {
fn describe(&self) -> String {
format!("Remove use '{}'", self.path)
}
fn mutation_type(&self) -> &'static str {
"RemoveUse"
}
fn box_clone(&self) -> Box<dyn Mutation> {
Box::new(self.clone())
}
}