Skip to content

Commit f5266b8

Browse files
authored
Migrate to core::error::Error (#1711)
1 parent 70d3103 commit f5266b8

File tree

17 files changed

+51
-61
lines changed

17 files changed

+51
-61
lines changed

.github/workflows/async-signature.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
matrix:
2525
rust:
26-
- 1.75.0 # MSRV
26+
- 1.81.0 # MSRV
2727
- stable
2828
target:
2929
- thumbv7em-none-eabi

.github/workflows/password-hash.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
rust:
25-
- 1.60.0 # MSRV
25+
- 1.81.0 # MSRV
2626
- stable
2727
target:
2828
- thumbv7em-none-eabi
@@ -57,7 +57,7 @@ jobs:
5757
strategy:
5858
matrix:
5959
rust:
60-
- 1.60.0 # MSRV
60+
- 1.81.0 # MSRV
6161
- stable
6262
steps:
6363
- uses: actions/checkout@v4

.github/workflows/signature.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
matrix:
2626
rust:
27-
- 1.72.0 # MSRV
27+
- 1.81.0 # MSRV
2828
- stable
2929
target:
3030
- thumbv7em-none-eabi
@@ -68,7 +68,7 @@ jobs:
6868
strategy:
6969
matrix:
7070
rust:
71-
- 1.72.0 # MSRV
71+
- 1.81.0 # MSRV
7272
- stable
7373
steps:
7474
- uses: actions/checkout@v4

async-signature/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ readme = "README.md"
1111
keywords = ["crypto", "ecdsa", "ed25519", "signature", "signing"]
1212
categories = ["cryptography", "no-std"]
1313
edition = "2021"
14-
rust-version = "1.75"
14+
rust-version = "1.81"
1515

1616
[dependencies]
1717
signature = "=2.3.0-pre.4"

async-signature/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
## Minimum Supported Rust Version
1111

12-
Rust **1.75** or higher.
12+
Rust **1.81** or higher.
1313

1414
Minimum supported Rust version can be changed in the future, but it will be
1515
done with a minor version bump.
@@ -36,7 +36,7 @@ dual licensed as above, without any additional terms or conditions.
3636
[docs-image]: https://docs.rs/async-signature/badge.svg
3737
[docs-link]: https://docs.rs/async-signature/
3838
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
39-
[rustc-image]: https://img.shields.io/badge/rustc-1.75+-blue.svg
39+
[rustc-image]: https://img.shields.io/badge/rustc-1.81+-blue.svg
4040
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
4141
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures
4242
[build-image]: https://github.com/RustCrypto/traits/workflows/async-signature/badge.svg?branch=master&event=push

digest/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ impl fmt::Display for InvalidOutputSize {
284284
}
285285
}
286286

287-
#[cfg(feature = "std")]
288-
impl std::error::Error for InvalidOutputSize {}
287+
impl core::error::Error for InvalidOutputSize {}
289288

290289
/// Buffer length is not equal to hash output size.
291290
#[derive(Default, Debug, Copy, Clone, Eq, PartialEq)]
@@ -297,8 +296,7 @@ impl fmt::Display for InvalidBufferSize {
297296
}
298297
}
299298

300-
#[cfg(feature = "std")]
301-
impl std::error::Error for InvalidBufferSize {}
299+
impl core::error::Error for InvalidBufferSize {}
302300

303301
#[cfg(feature = "std")]
304302
mod hashwriter;

digest/src/mac.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,5 +278,4 @@ impl fmt::Display for MacError {
278278
}
279279
}
280280

281-
#[cfg(feature = "std")]
282-
impl std::error::Error for MacError {}
281+
impl core::error::Error for MacError {}

password-hash/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repository = "https://github.com/RustCrypto/traits"
1515
categories = ["authentication", "cryptography", "no-std"]
1616
keywords = ["crypt", "mcf", "password", "pbkdf", "phc"]
1717
edition = "2021"
18-
rust-version = "1.60"
18+
rust-version = "1.81"
1919

2020
[dependencies]
2121
base64ct = "1.6"
@@ -27,7 +27,6 @@ rand_core = { version = "0.6.4", optional = true, default-features = false }
2727
[features]
2828
default = ["rand_core"]
2929
alloc = ["base64ct/alloc"]
30-
std = ["alloc", "base64ct/std", "rand_core/std"]
3130

3231
getrandom = ["rand_core/getrandom"]
3332

password-hash/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ this crate for interoperability:
2929

3030
## Minimum Supported Rust Version
3131

32-
Rust **1.60** or higher.
32+
Rust **1.81** or higher.
3333

3434
Minimum supported Rust version may be changed in the future, but it will be
3535
accompanied by a minor version bump.
@@ -63,7 +63,7 @@ dual licensed as above, without any additional terms or conditions.
6363
[build-image]: https://github.com/RustCrypto/traits/workflows/password-hash/badge.svg?branch=master&event=push
6464
[build-link]: https://github.com/RustCrypto/traits/actions?query=workflow:password-hash
6565
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
66-
[rustc-image]: https://img.shields.io/badge/rustc-1.60+-blue.svg
66+
[rustc-image]: https://img.shields.io/badge/rustc-1.81+-blue.svg
6767
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
6868
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260046-password-hashes
6969

password-hash/src/errors.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ impl fmt::Display for Error {
9999
}
100100
}
101101

102-
#[cfg(feature = "std")]
103-
impl std::error::Error for Error {
104-
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
102+
impl core::error::Error for Error {
103+
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
105104
match self {
106-
Self::B64Encoding(err) => Some(err),
105+
// TODO: restore after base64ct will migrate to core::error::Error
106+
// Self::B64Encoding(err) => Some(err),
107107
Self::ParamValueInvalid(err) => Some(err),
108108
Self::SaltInvalid(err) => Some(err),
109109
_ => None,
@@ -167,5 +167,4 @@ impl fmt::Display for InvalidValue {
167167
}
168168
}
169169

170-
#[cfg(feature = "std")]
171-
impl std::error::Error for InvalidValue {}
170+
impl core::error::Error for InvalidValue {}

0 commit comments

Comments
 (0)