Skip to content

Commit e317fad

Browse files
Merge #1175
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 <[email protected]>
2 parents 1e39a28 + edb2632 commit e317fad

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
88
### Changed
99
### Fixed
1010
### Removed
11+
- Removed deprecated Error::description from error types
12+
(#[1175](https://github.com/nix-rust/nix/pull/1175))
1113

1214
## [0.16.1] - 23 December 2019
1315
### Added

src/errno.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,7 @@ impl ErrnoSentinel for libc::sighandler_t {
111111
fn sentinel() -> Self { libc::SIG_ERR }
112112
}
113113

114-
impl error::Error for Errno {
115-
fn description(&self) -> &str {
116-
self.desc()
117-
}
118-
}
114+
impl error::Error for Errno {}
119115

120116
impl fmt::Display for Errno {
121117
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/lib.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,7 @@ impl From<std::string::FromUtf8Error> for Error {
152152
fn from(_: std::string::FromUtf8Error) -> Error { Error::InvalidUtf8 }
153153
}
154154

155-
impl error::Error for Error {
156-
fn description(&self) -> &str {
157-
match *self {
158-
Error::InvalidPath => "Invalid path",
159-
Error::InvalidUtf8 => "Invalid UTF-8 string",
160-
Error::UnsupportedOperation => "Unsupported Operation",
161-
Error::Sys(ref errno) => errno.desc(),
162-
}
163-
}
164-
}
155+
impl error::Error for Error {}
165156

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

0 commit comments

Comments
 (0)