Skip to content

Commit 9c13486

Browse files
committed
Improve docs further
Specify the actual path from `Box<[u8]>` to `SecretString` with a copy.
1 parent 7b8b309 commit 9c13486

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

secrecy/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ impl SecretBox<str> {
196196
/// This works like [`String::from_utf8`], except that the buffer is truncated to the specified
197197
/// length before the string is created. Note that the allocation is not resized; if the buffer
198198
/// is much larger than the resulting string, this is wasteful, and it is probably better to
199-
/// call [`SecretString::from`] on the slice to make a new allocation with only the needed size.
199+
/// call [`str::from_utf8`] on the slice to make a new allocation with only the needed size, and
200+
/// then pass that to [`SecretString::from`].
200201
pub fn from_utf8_box_len(
201202
mut other: SecretBox<[u8]>,
202203
len: usize,

0 commit comments

Comments
 (0)