From e78de7510753b34830cbaee43efafbd53b8f6242 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 8 Oct 2024 15:55:02 -0600 Subject: [PATCH] aead: use `core::error`; remove `std` feature (#1692) 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. --- aead/Cargo.toml | 1 - aead/src/lib.rs | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/aead/Cargo.toml b/aead/Cargo.toml index b0a7bc25b..9cfaa2ff9 100644 --- a/aead/Cargo.toml +++ b/aead/Cargo.toml @@ -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"] diff --git a/aead/src/lib.rs b/aead/src/lib.rs index 468b06762..63be73a7d 100644 --- a/aead/src/lib.rs +++ b/aead/src/lib.rs @@ -16,9 +16,6 @@ #[cfg(feature = "alloc")] extern crate alloc; -#[cfg(feature = "std")] -extern crate std; - #[cfg(feature = "dev")] pub mod dev; @@ -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 = Array::NonceSize>;