Skip to main content

ryo_mutations/basic/
mod_decl.rs

1//! Module declaration mutations: RemoveModMutation
2//!
3//! Note: AddMod was consolidated into CreateMod.
4
5use crate::Mutation;
6use ryo_symbol::SymbolId;
7
8/// Remove a module declaration from the file
9#[derive(Debug, Clone)]
10pub struct RemoveModMutation {
11    /// SymbolId of the module to remove (required, O(1) access)
12    pub module_id: SymbolId,
13}
14
15impl RemoveModMutation {
16    pub fn new(module_id: SymbolId) -> Self {
17        Self { module_id }
18    }
19}
20
21impl Mutation for RemoveModMutation {
22    fn describe(&self) -> String {
23        format!("Remove mod {}", self.module_id)
24    }
25
26    fn mutation_type(&self) -> &'static str {
27        "RemoveMod"
28    }
29
30    fn box_clone(&self) -> Box<dyn Mutation> {
31        Box::new(self.clone())
32    }
33}