summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-01-10 22:31:06 +0000
committerGitHub <noreply@github.com>2020-01-10 22:31:06 +0000
commite317fad7a4aaedbce1d3c16bbea8c04a1f09ff69 (patch)
treebc6903d44d809b16234f04c20f822870fb139e55
parent1e39a2805d125dd55fa8e24aa9afdc1c8350094d (diff)
parentedb263220868491c93c466021f5dd8010d324026 (diff)
downloadnix-e317fad7a4aaedbce1d3c16bbea8c04a1f09ff69.zip
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: https://github.com/rust-lang/rust/pull/66919 Co-authored-by: Radyk Andrii <ander.ender@gmail.com>
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/errno.rs6
-rw-r--r--src/lib.rs11
3 files changed, 4 insertions, 15 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f6478ccc..8e7a3c4f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/src/errno.rs b/src/errno.rs
index 287bbea4..a8a2bf24 100644
--- a/src/errno.rs
+++ b/src/errno.rs
@@ -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 {
diff --git a/src/lib.rs b/src/lib.rs
index d9ba026e..410db186 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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 {