Closed
Description
I'm a little confused by the latest AeadCore::generate_nonce()
API:
in code, it seems to be
#[cfg(feature = "rand_core")]
#[cfg_attr(docsrs, doc(cfg(feature = "rand_core")))]
fn generate_nonce(mut rng: impl CryptoRng + RngCore) -> Nonce<Self>
where
Nonce<Self>: Default,
{
let mut nonce = Nonce::<Self>::default();
rng.fill_bytes(&mut nonce);
nonce
}
however in rustdoc (latest/v0.5.1), it seem to be accepting an immutable rng
: fn generate_nonce(rng: impl CryptoRng + RngCore) -> Nonce<Self>
that's the first confusion.
The second confusion is, why does it accept mut rng
instead of &mut rng
?