Skip to content

Commit

Permalink
aead: use core::error; remove std feature (#1692)
Browse files Browse the repository at this point in the history
Switches from `std::error::Error` to `core::error::Error` which was
stabilized in Rust 1.81, which is already the `aead` crate's current
MSRV.

Since this was the only usage of `std`, also removes the `std` feature.
  • Loading branch information
tarcieri authored Oct 8, 2024
1 parent 60f5e98 commit e78de75
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion aead/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ heapless = { version = "0.8", optional = true, default-features = false }
[features]
default = ["rand_core"]
alloc = []
std = ["alloc"]
dev = ["blobby"]
getrandom = ["crypto-common/getrandom"]
rand_core = ["crypto-common/rand_core"]
Expand Down
6 changes: 1 addition & 5 deletions aead/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#[cfg(feature = "alloc")]
extern crate alloc;

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

#[cfg(feature = "dev")]
pub mod dev;

Expand Down Expand Up @@ -69,8 +66,7 @@ impl fmt::Display for Error {
}
}

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

/// Nonce: single-use value for ensuring ciphertexts are unique
pub type Nonce<A> = Array<u8, <A as AeadCore>::NonceSize>;
Expand Down

0 comments on commit e78de75

Please sign in to comment.