From eaf55a97f298865262c3ea9c1dde15efdaafc865 Mon Sep 17 00:00:00 2001 From: BlackHoleFox Date: Mon, 26 Aug 2024 14:44:45 -0500 Subject: [PATCH] argon2: only enable password-hash dependency if its been explicitly requested --- argon2/Cargo.toml | 6 +++--- argon2/src/lib.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/argon2/Cargo.toml b/argon2/Cargo.toml index fcdd5651..59a10c1d 100644 --- a/argon2/Cargo.toml +++ b/argon2/Cargo.toml @@ -33,10 +33,10 @@ password-hash = { version = "0.6.0-rc.0", features = ["rand_core"] } [features] default = ["alloc", "password-hash", "rand"] -alloc = ["password-hash/alloc"] -std = ["alloc", "password-hash/std"] +alloc = ["password-hash?/alloc"] +std = ["alloc", "password-hash?/std"] -rand = ["password-hash/rand_core"] +rand = ["password-hash?/rand_core"] simple = ["password-hash"] [lints.rust.unexpected_cfgs] diff --git a/argon2/src/lib.rs b/argon2/src/lib.rs index a8b801f2..1ef5c0b7 100644 --- a/argon2/src/lib.rs +++ b/argon2/src/lib.rs @@ -30,8 +30,8 @@ //! password-based authentication. Do not use this API to derive cryptographic //! keys: see the "key derivation" usage example below. //! -#![cfg_attr(feature = "std", doc = "```")] -#![cfg_attr(not(feature = "std"), doc = "```ignore")] +#![cfg_attr(all(feature = "password-hash", feature = "std"), doc = "```")] +#![cfg_attr(not(all(feature = "password-hash", feature = "std")), doc = "```ignore")] //! # fn main() -> Result<(), Box> { //! use argon2::{ //! password_hash::{ @@ -65,8 +65,8 @@ //! This API is useful for transforming a password into cryptographic keys for //! e.g. password-based encryption. //! -#![cfg_attr(feature = "std", doc = "```")] -#![cfg_attr(not(feature = "std"), doc = "```ignore")] +#![cfg_attr(all(feature = "password-hash", feature = "std"), doc = "```")] +#![cfg_attr(not(all(feature = "password-hash", feature = "std")), doc = "```ignore")] //! # fn main() -> Result<(), Box> { //! use argon2::Argon2; //!