Skip to content

Commit

Permalink
crypto-common: use core::error::Error trait; MSRV 1.81 (#1660)
Browse files Browse the repository at this point in the history
The `core::error::Error` trait is now stable, meaning we no longer need
to gate impls for it on a `std` feature.
  • Loading branch information
tarcieri authored Sep 28, 2024
1 parent c7a7fa4 commit 66ca151
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/crypto-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: crypto-common

on:
pull_request:
paths:
- "crypto-common/**"
- "Cargo.*"
paths:
- "crypto-common/**"
- "Cargo.*"
push:
branches: master

Expand All @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
rust:
- 1.65.0 # MSRV
- 1.81.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
Expand All @@ -39,14 +39,14 @@ jobs:
minimal-versions:
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
with:
working-directory: ${{ github.workflow }}
working-directory: ${{ github.workflow }}

test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.65.0 # MSRV
- 1.81.0 # MSRV
- stable
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion crypto-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
edition = "2021"
rust-version = "1.65"
rust-version = "1.81"
documentation = "https://docs.rs/crypto-common"
repository = "https://github.com/RustCrypto/traits"
keywords = ["crypto", "traits"]
Expand Down
4 changes: 2 additions & 2 deletions crypto-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ higher-level trait crates instead of this one.

## Minimum Supported Rust Version

Rust **1.65** or higher.
Rust **1.81** or higher.

Minimum supported Rust version can be changed in the future, but it will be
done with a minor version bump.
Expand Down Expand Up @@ -46,7 +46,7 @@ dual licensed as above, without any additional terms or conditions.
[docs-image]: https://docs.rs/crypto-common/badge.svg
[docs-link]: https://docs.rs/crypto-common/
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.65+-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.81+-blue.svg
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes
[build-image]: https://github.com/RustCrypto/traits/workflows/crypto-common/badge.svg?branch=master&event=push
Expand Down
3 changes: 1 addition & 2 deletions crypto-common/src/hazmat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ impl fmt::Display for DeserializeStateError {
}
}

#[cfg(feature = "std")]
impl std::error::Error for DeserializeStateError {}
impl core::error::Error for DeserializeStateError {}

/// Types which can serialize the internal state and be restored from it.
///
Expand Down
6 changes: 1 addition & 5 deletions crypto-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms, missing_debug_implementations)]

#[cfg(feature = "std")]
extern crate std;

/// Hazardous materials.
pub mod hazmat;

Expand Down Expand Up @@ -389,5 +386,4 @@ impl fmt::Display for InvalidLength {
}
}

#[cfg(feature = "std")]
impl std::error::Error for InvalidLength {}
impl core::error::Error for InvalidLength {}

0 comments on commit 66ca151

Please sign in to comment.