Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
[package]
name = "coset"
version = "0.4.0"
version = "0.4.1"
authors = ["David Drysdale <[email protected]>", "Paul Crowley <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
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]
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ 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

This crate supports `no_std` (when the `std` feature is not set, which is the default), but uses the `alloc` crate.

## Minimum Supported Rust Version

MSRV is 1.58.
MSRV is 1.81.

## Integer Ranges

Expand Down
3 changes: 1 addition & 2 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ pub fn expect_err<T: core::fmt::Debug, E: core::fmt::Debug + core::fmt::Display>
result: Result<T, E>,
err_msg: &str,
) {
#[cfg(not(feature = "std"))]
use alloc::format;
match result {
Ok(_) => {
Expand Down
Loading