diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb10811..ace4a39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,7 +93,7 @@ jobs: strategy: fail-fast: false matrix: - rust: [1.58.0, 1.59.0] + rust: [1.81.0, 1.82.0] steps: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: diff --git a/Cargo.lock b/Cargo.lock index 3fe2a01..c484aaf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "ciborium" @@ -31,7 +31,7 @@ dependencies = [ [[package]] name = "coset" -version = "0.4.0" +version = "0.4.1" dependencies = [ "ciborium", "ciborium-io", diff --git a/Cargo.toml b/Cargo.toml index 1ce175c..7df7c90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "coset" -version = "0.4.0" +version = "0.4.1" authors = ["David Drysdale ", "Paul Crowley "] edition = "2018" license = "Apache-2.0" @@ -8,10 +8,14 @@ description = "Set of types for supporting COSE" repository = "https://github.com/google/coset" keywords = ["cryptography", "cose"] categories = ["cryptography"] +rust-version = "1.81" [features] default = [] -# `std` feature enables an `Error` impl for `CoseError` + +# The `std` feature is maintained for back-compatibility; it previously enabled a +# `std::error::Error` impl for `CoseError`, but the code now (always) has a +# `core::error::Error` impl. std = [] [dependencies] diff --git a/README.md b/README.md index 5fb69b6..54994aa 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ example](examples/signature.rs) for documentation on how to use the code. ## Features -The `std` feature of the crate enables an implementation of `std::error::Error` for `CoseError`. +The `std` feature of the crate does nothing, and is maintained for back-compatibility. (It previously +enabled an implementation of `std::error::Error` for `CoseError`, but there is now an implementation +of `core::error::Error` that is always present.) ## `no_std` Support @@ -23,7 +25,7 @@ This crate supports `no_std` (when the `std` feature is not set, which is the de ## Minimum Supported Rust Version -MSRV is 1.58. +MSRV is 1.81. ## Integer Ranges diff --git a/src/common/mod.rs b/src/common/mod.rs index b2c6b78..3d9c630 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -95,8 +95,7 @@ impl core::fmt::Display for CoseError { } } -#[cfg(feature = "std")] -impl std::error::Error for CoseError {} +impl core::error::Error for CoseError {} impl CoseError { fn fmt_msg(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { diff --git a/src/lib.rs b/src/lib.rs index 1d1eed5..4ce9c93 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -96,7 +96,7 @@ //! [COSE]: https://tools.ietf.org/html/rfc8152 //! [CBOR]: https://tools.ietf.org/html/rfc7049 -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #![deny(rustdoc::broken_intra_doc_links)] extern crate alloc; diff --git a/src/util/mod.rs b/src/util/mod.rs index 6da9bf4..79d6b1a 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -164,7 +164,6 @@ pub fn expect_err result: Result, err_msg: &str, ) { - #[cfg(not(feature = "std"))] use alloc::format; match result { Ok(_) => {