INNER CODE UNIT · Rust

fmt

dontpanic92/OpenPAL3 · crosscom/ccidl-rs/src/lib.rs:27

    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Error::Io { path, source } => {
                write!(f, "failed to read {}: {}", path.display(), source)
            }
            Error::Parse { path, message } => {
                write!(f, "failed to parse {}: {}", path.display(), message)
            }
            Error::Generate(message) => write!(f, "failed to generate Rust source: {message}"),
        }
    }
}

impl std::error::Error for Error {}

pub fn generate(idl_path: impl AsRef<Path>) -> Result<GeneratedUnit, Error> {
    let idl_path = idl_path.as_ref();
    let mut dependencies = Vec::new();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…