Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/secret_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ impl<T: Bytes> SecretVec<T> {
/// # Errors
///
/// Returns `Err` only if the user-provided callback does.
pub fn try_new<U, E, F>(f: F) -> Result<Self, E>
pub fn try_new<U, E, F>(len: usize, f: F) -> Result<Self, E>
where
F: FnOnce(&mut [T]) -> Result<U, E>,
{
Box::try_new(1, |b| f(b.as_mut_slice()))
Box::try_new(len, |b| f(b.as_mut_slice()))
.map(|b| Self { boxed: b })
}

Expand Down