Skip to main content

edikt_core/
error.rs

1//! Edit errors, shared across format modules.
2
3/// A format-preserving edit failure (bad path, wrong type for the operation,
4/// unsupported construct).
5#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
6#[error("{msg}")]
7pub struct EditError {
8    pub msg: String,
9}
10
11impl EditError {
12    pub fn new(msg: impl Into<String>) -> EditError {
13        EditError { msg: msg.into() }
14    }
15}