Closed
Description
The rand_core:0.5.0::Error
is reduced down to an integer code, which has exactly as much value as no error at all. The stored integer carries no information whatsoever (esp. in generic contexts) and the error, if Display
ed conveys no useful information either.
Consider for example:
fn foo<R: RandCore>(rng: R) {
match rng.try_fill_bytes(...) {
Err(e) => {
// In this context "error code 42" is about as useful as
// "an error has occurred" or "bad things happened"
//
// Furthermore, each implementation of `RngCore` can map
// error numbers to causes in arbitrary ways, which makes
// whatever interpretation that could be derived in this generic
// context misleadingly wrong, even.
}
}
}
With that in mind, the next version should reconsider this API change.
Metadata
Metadata
Assignees
Labels
No labels