Skip to content
Merged
Show file tree
Hide file tree
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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/strings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use crate::{Error, Result};
/// Encode a `&str` as a nul-terminated UTF-16 buffer.
///
/// The buffer is allocated with its final capacity up front so no intermediate
/// heap copy of the data is left behind (relevant for the `zeroize` feature).
/// heap copy of the data is left behind (relevant when the result is wrapped in
/// a [`WideSecret`] that is zeroized on drop).
/// The interior-NUL check runs on the `&str` before any allocation — a non-NUL
/// char never encodes to a 0 UTF-16 unit, so it is equivalent to scanning the
/// encoded buffer — which keeps the error path free of transient copies too.
Expand Down
Loading