Skip to content

Commit

Permalink
Merge #1175
Browse files Browse the repository at this point in the history
1175: Remove deprecated Error::description r=asomers a=AnderEnder

`Error::description` has been documented as soft-deprecated since 1.27.0 (17 months ago). It is going to be hard-deprecated soon.

This PR:
- Removes all implementations of `description` in all error types

Related PR: rust-lang/rust#66919

Co-authored-by: Radyk Andrii <ander.ender@gmail.com>
  • Loading branch information
bors[bot] and AnderEnder committed Jan 10, 2020
2 parents 1e39a28 + edb2632 commit e317fad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed
### Fixed
### Removed
- Removed deprecated Error::description from error types
(#[1175](https://github.com/nix-rust/nix/pull/1175))

## [0.16.1] - 23 December 2019
### Added
Expand Down
6 changes: 1 addition & 5 deletions src/errno.rs
Expand Up @@ -111,11 +111,7 @@ impl ErrnoSentinel for libc::sighandler_t {
fn sentinel() -> Self { libc::SIG_ERR }
}

impl error::Error for Errno {
fn description(&self) -> &str {
self.desc()
}
}
impl error::Error for Errno {}

impl fmt::Display for Errno {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
11 changes: 1 addition & 10 deletions src/lib.rs
Expand Up @@ -152,16 +152,7 @@ impl From<std::string::FromUtf8Error> for Error {
fn from(_: std::string::FromUtf8Error) -> Error { Error::InvalidUtf8 }
}

impl error::Error for Error {
fn description(&self) -> &str {
match *self {
Error::InvalidPath => "Invalid path",
Error::InvalidUtf8 => "Invalid UTF-8 string",
Error::UnsupportedOperation => "Unsupported Operation",
Error::Sys(ref errno) => errno.desc(),
}
}
}
impl error::Error for Error {}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down

0 comments on commit e317fad

Please sign in to comment.