Open asomers opened 2 years ago
the fuse3::Errno
also implement From<std::io::Error>
, that can help user convert the io error to Errno
, or when they want to convert to the io::Error
, they can use err.into()
directly
Which helps if their crate's native error type is io::Error, but not other arbitrary error types. For example, in my case it's nix::Errno.
fuse3 currently defines a custom Error type, a wrapper around errno, which implements
From<i32>
. That is pretty convenient to use for a crate whose native errors are alsoi32
, or whose custom error type can implementInto<fuse3::Errno>
. However, it's a problem for a crate whose custom error type comes from a third crate, because Rust's trait impl rules don't allow a crate to implementFrom
orInto
to convert between two external types. Looking at the source, it seems thefuse3::Error
type only exists for the sake of a few one-line convenience methods likeis_not_exist
andnew_not_exist
. I think the switch could be done with almost no net change in line count. If you agree, I can prepare a PR.