mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-15 06:20:32 +02:00
Error is not yet available in core on stable (#1005)
This commit is contained in:
parent
3568823731
commit
46a38bc67a
@ -52,8 +52,9 @@ Key points:
|
||||
* The `username` variable can be either `Ok(string)` or `Err(error)`.
|
||||
* Use the `fs::write` call to test out the different scenarios: no file, empty file, file with username.
|
||||
|
||||
It is good practice for all error types to implement `std::error::Error`, which requires `Debug` and
|
||||
`Display`. It's generally helpful for them to implement `Clone` and `Eq` too where possible, to make
|
||||
It is good practice for all error types that don't need to be `no_std` to implement `std::error::Error`, which requires `Debug` and `Display`. The `Error` crate for `core` is only available in [nightly](https://github.com/rust-lang/rust/issues/103765), so not fully `no_std` compatible yet.
|
||||
|
||||
It's generally helpful for them to implement `Clone` and `Eq` too where possible, to make
|
||||
life easier for tests and consumers of your library. In this case we can't easily do so, because
|
||||
`io::Error` doesn't implement them.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user