fn log_message(self) {
        match self {
            EditErr::MoveToSiblingOfRoot => log::warn!("Can't move to a sibling of the root."),
            EditErr::NoChangesToUndo => log::warn!("No changes to undo."),
            EditErr::NoChangesToRedo => log::warn!("No changes to redo."),
            EditErr::NoNodesToInsert => log::warn!("No nodes to insert."),
            EditErr::InsertError(e) => log::warn!("{}", e),
            EditErr::DeleteError(e) => log::warn!("{}", e),
            EditErr::CharNotANode(c) => log::warn!("'{}' doesn't correspond to any node type.", c),
            EditErr::CannotBeRoot(c) => {
                log::warn!("'{}' cannot be root", c.name())
            }
            EditErr::CannotBeChild { class, parent_name } => {
                log::warn!("'{}' cannot be a child of {}", class.name(), parent_name)
            }
            EditErr::ReplaceError {
                current_child_index,
                last_child_index,
                node_count,
            } => {
                log::warn!(
                    "Current child index: {}, Last child index {}, to be replaced node count {}",
                    current_child_index,
                    last_child_index,
                    node_count,
                )
            }
            EditErr::AddSiblingToRoot => log::warn!("Can't add siblings to the root."),
            EditErr::DeletingRoot => log::warn!("Can't delete the root."),
        }
    }
/// Writes an warning message of the encountered error using either `warn!` or `error!`,
/// depending on the severity of the error
Writes an warning message of the encountered error using either `warn!` or `error!`,
depending on the severity of the error
Writes an warning message of the encountered error using either ` warn! ` or ` error! ` depending on the severity of the error
fn log_message(self) {
        match self {
            EditErr::MoveToSiblingOfRoot => log::warn!("Can't move to a sibling of the root."),
            EditErr::NoChangesToUndo => log::warn!("No changes to undo."),
            EditErr::NoChangesToRedo => log::warn!("No changes to redo."),
            EditErr::NoNodesToInsert => log::warn!("No nodes to insert."),
            EditErr::InsertError(e) => log::warn!("{}", e),
            EditErr::DeleteError(e) => log::warn!("{}", e),
            EditErr::CharNotANode(c) => log::warn!("'{}' doesn't correspond to any node type.", c),
            EditErr::CannotBeRoot(c) => {
                log::warn!("'{}' cannot be root", c.name())
            }
            EditErr::CannotBeChild { class, parent_name } => {
                log::warn!("'{}' cannot be a child of {}", class.name(), parent_name)
            }
            EditErr::ReplaceError {
                current_child_index,
                last_child_index,
                node_count,
            } => {
                log::warn!(
                    "Current child index: {}, Last child index {}, to be replaced node count {}",
                    current_child_index,
                    last_child_index,
                    node_count,
                )
            }
            EditErr::AddSiblingToRoot => log::warn!("Can't add siblings to the root."),
            EditErr::DeletingRoot => log::warn!("Can't delete the root."),
        }
    }
fn log_message ( self ) { match self { EditErr :: MoveToSiblingOfRoot => log :: warn ! ( " " ) , EditErr :: NoChangesToUndo => log :: warn ! ( " " ) , EditErr :: NoChangesToRedo => log :: warn ! ( " " ) , EditErr :: NoNodesToInsert => log :: warn ! ( " " ) , EditErr :: InsertError ( e ) => log :: warn ! ( " " e ) , EditErr :: DeleteError ( e ) => log :: warn ! ( " " e ) , EditErr :: CharNotANode ( c ) => log :: warn ! ( " " c ) , EditErr :: CannotBeRoot ( c ) => { log :: warn ! ( " " c name ( ) ) } EditErr :: CannotBeChild { class , parent_name } => { log :: warn ! ( " " class name ( ) parent_name ) } EditErr :: ReplaceError { current_child_index , last_child_index , node_count , } => { log :: warn ! ( " " current_child_index last_child_index node_count ) } EditErr :: AddSiblingToRoot => log :: warn ! ( " " ) , EditErr :: DeletingRoot => log :: warn ! ( " " ) , } }
Writes an warning message of the encountered error using either `warn!` or `error!`,
depending on the severity of the error
Writes an warning message of the encountered error using either ` warn! ` or ` error! ` depending on the severity of the error
self
self