You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find CapErr to be confusing. Every type wraps either io::Error or ffi::NulError. The variants mainly serve to tell the user which function returned the error. But the user already knows that. I propose that we use plain io::Result for all functions whose inner error type is an io::Error. And for the few functions with more complicated error types we'll make an enum for each one. That's essentially the approach we take in the Nix crate.
The text was updated successfully, but these errors were encountered:
CapErr simply served to wrap an io::Error around an enum that mainly
just served to tell the user what function he had just called. But the
user already knew that. Simpler just to return io::Error directly. The
only complication was Directory::open_file, which needs to handle a
NulError. I mapped that to io::Error with an ErrorKind of Other.
Fixesdlrobertson#25
CapErr simply served to wrap an io::Error around an enum that mainly
just served to tell the user what function he had just called. But the
user already knew that. Simpler just to return io::Error directly. The
only complication was Directory::open_file, which needs to handle a
NulError. I mapped that to io::Error with an ErrorKind of Other.
Fixesdlrobertson#25
I find
CapErr
to be confusing. Every type wraps eitherio::Error
orffi::NulError
. The variants mainly serve to tell the user which function returned the error. But the user already knows that. I propose that we use plainio::Result
for all functions whose inner error type is anio::Error
. And for the few functions with more complicated error types we'll make an enum for each one. That's essentially the approach we take in the Nix crate.The text was updated successfully, but these errors were encountered: