From 98232c7bc262dd3902b8f3e299196ab9c83fb355 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 8 Jul 2020 12:08:26 +0200 Subject: Remove sync::PoisonError from Error::PoisonError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the Error::PoisonError contained the sync::PoisonError that caused the error. This is problematic as sync::PoisonError does not implement Send, making it impossible to use the Error enum with the anyhow crate. At the same time, storing the sync::PoisonError is not very useful. If a user wants to access the poisoned lock, they can call the force_take function. Therefore we remove the sync::PoisonError value from the Error:: PoisonError variant. This also allows us to simplify the From> and From> implementations as we no longer need to know the type of the mutex that caused the error. For more information, see this thread: https://lists.sr.ht/~ireas/nitrokey-rs-dev/%3C68ed0f3f-d98f-63bc-04d2-81b6d6cde560%40posteo.net%3E --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index e2dd8a7..dddccb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Copyright (C) 2019-2020 Robin Krahl SPDX-License-Identifier: CC0-1.0 --> +# Unreleased +- Refactor the `Error` enum so that it is `Send`, `Sync` and `'static`: + - Remove the `sync::PoisonError` from the `PoisonError` variant. + # v0.6.0 (2020-02-03) - Add `String` value to the `Error::UnexpectedError` variant. - Always store serial numbers as structs: -- cgit v1.2.1 From 3f402dc13530ce4de167bae843200cfbd72ed69b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 8 Jul 2020 22:22:10 +0200 Subject: Remove Error::RandError variant Since we update rand_os to version 0.2 in commit 6c138eaa850c745b97b7e48a201db0cbaad8e1e0, the random number generation can no longer fail. Therefore the Error::RandError variant is no longer needed. As we did not want to break the public API, we still kept the RandError variant. This patch removes the RandError variant for good. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index dddccb1..651a50e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ SPDX-License-Identifier: CC0-1.0 # Unreleased - Refactor the `Error` enum so that it is `Send`, `Sync` and `'static`: - Remove the `sync::PoisonError` from the `PoisonError` variant. + - Remove `Error::RandError` variant. # v0.6.0 (2020-02-03) - Add `String` value to the `Error::UnexpectedError` variant. -- cgit v1.2.1 From 8f72f038cab8e61fb162c12c4bd4cbaa243faa2d Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 14 Jul 2020 21:52:06 +0200 Subject: Release v0.7.0 This release changes the Error enum to implement Send, Sync and 'static for compatibility with error handling crates like anyhow. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 651a50e..736620d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Copyright (C) 2019-2020 Robin Krahl SPDX-License-Identifier: CC0-1.0 --> -# Unreleased +# v0.7.0 (2020-07-14) - Refactor the `Error` enum so that it is `Send`, `Sync` and `'static`: - Remove the `sync::PoisonError` from the `PoisonError` variant. - Remove `Error::RandError` variant. -- cgit v1.2.1