You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps I do not understand something, but how can one use the current API to actually mutate the insides of the secret? In my case, I want to create a secret random seed, so I write
let key = SecretBytesMut::new(BytesMut::zeroed(32));OsRng.fill_bytes(key.expose_secret().as_mut());
Which results in a "cannot borrow as mutable" for key.expose_secret().as_mut(). Which I understand - expose_secret() returns an immutable reference - but how to get a mutable access to the bytes then?
The text was updated successfully, but these errors were encountered:
Perhaps I do not understand something, but how can one use the current API to actually mutate the insides of the secret? In my case, I want to create a secret random seed, so I write
Which results in a "cannot borrow as mutable" for
key.expose_secret().as_mut()
. Which I understand -expose_secret()
returns an immutable reference - but how to get a mutable access to the bytes then?The text was updated successfully, but these errors were encountered: