Skip to content

crypto-common: use core::error::Error trait; MSRV 1.81 #1660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.79.0
toolchain: 1.81.0
components: clippy
- run: cargo clippy --all --all-features --tests -- -D warnings

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 {}