ryo-source 0.1.0

High-speed Rust AST manipulation engine
Documentation
//! Error types for Rust AST manipulation.

use thiserror::Error;

/// Result type for source operations.
pub type SourceResult<T> = Result<T, SourceError>;

/// Errors that can occur during AST manipulation.
#[derive(Debug, Error)]
pub enum SourceError {
    /// Failed to parse Rust source code.
    #[error("Parse error: {0}")]
    ParseError(String),

    /// File I/O error.
    #[error("IO error: {0}")]
    IoError(#[from] std::io::Error),

    /// Invalid transformation.
    #[error("Invalid transformation: {0}")]
    InvalidTransformation(String),
}

impl From<syn::Error> for SourceError {
    fn from(err: syn::Error) -> Self {
        SourceError::ParseError(err.to_string())
    }
}