First, a big thank you for rewriting this splendid library !
I want to make this very small contribution.
Default implementation of std::error::Error for VcardError. Allow the use of the operator '?' to propagate the error of this crate in a more generic way.
For example, this code would compile with this patch.
use std::error::Error;
use vcard_parser::parse_vcards;
fn main() -> Result<(), Box<dyn Error>> {
parse_vcards("")?;
Ok(())
}
Without this patch, the compilation fails:
--> src/main.rs:5:21
|
5 | parse_vcards("")?;
| ^ the trait `std::error::Error` is not implemented for `VcardError`
|
= help: the following other types implement trait `FromResidual<R>`:
<Result<T, F> as FromResidual<Result<Infallible, E>>>
<Result<T, F> as FromResidual<Yeet<E>>>
= note: required for `Box<dyn std::error::Error>` to implement `From<VcardError>`
= note: required for `Result<(), Box<dyn std::error::Error>>` to implement `FromResidual<Result<Infallible, VcardError>>`
For more information about this error, try `rustc --explain E0277`.
First, a big thank you for rewriting this splendid library !
I want to make this very small contribution.
Default implementation of std::error::Error for VcardError. Allow the use of the operator '?' to propagate the error of this crate in a more generic way.
For example, this code would compile with this patch.
Without this patch, the compilation fails: