codama-errors 0.9.1

Errors and result types for Codama
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use codama_errors::CodamaError;
use std::io::ErrorKind::NotFound;

#[test]
fn from_io_error() {
    let error: CodamaError = std::io::Error::new(NotFound, "Could not find file `foo.rs`").into();
    assert!(matches!(error, CodamaError::Filesystem(_)));
}

#[test]
fn display() {
    let error: CodamaError = std::io::Error::new(NotFound, "Could not find file `foo.rs`").into();
    assert_eq!(error.to_string(), "Could not find file `foo.rs`");
}