ryo-mutations 0.1.0

[experimental] Code transformation primitives for Rust source code
Documentation
//! Module declaration mutations: RemoveModMutation
//!
//! Note: AddMod was consolidated into CreateMod.

use crate::Mutation;
use ryo_symbol::SymbolId;

/// Remove a module declaration from the file
#[derive(Debug, Clone)]
pub struct RemoveModMutation {
    /// SymbolId of the module to remove (required, O(1) access)
    pub module_id: SymbolId,
}

impl RemoveModMutation {
    pub fn new(module_id: SymbolId) -> Self {
        Self { module_id }
    }
}

impl Mutation for RemoveModMutation {
    fn describe(&self) -> String {
        format!("Remove mod {}", self.module_id)
    }

    fn mutation_type(&self) -> &'static str {
        "RemoveMod"
    }

    fn box_clone(&self) -> Box<dyn Mutation> {
        Box::new(self.clone())
    }
}