Skip to content

Commit e6b1758

Browse files
authored
Adjust SecretString docs to match implementation (#3388)
`SecretString` claims it zeroizes its content on last drop. This isn't currently the case and implementing that is around an `Arc<str>` is impractical -- requiring unsafe or further indirection -- and likely wouldn't be useful in reality. This commit instead adjusts its documentation to simply state it does not reveal the content in its `Debug` output.
1 parent 8f8d63d commit e6b1758

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/secrets.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use aformat::{CapStr, aformat};
88

99
/// A cheaply clonable, zeroed on drop, String.
1010
///
11-
/// This is a simple newtype of `Arc<str>` that uses [`zeroize::Zeroize`] on last drop to avoid
12-
/// keeping it around in memory.
11+
/// This is a simple newtype of `Arc<str>` that does not reveal its
12+
/// content in its [`Debug`](std::fmt::Debug) output.
1313
#[derive(Clone, Deserialize, Serialize)]
1414
pub struct SecretString(Arc<str>);
1515

0 commit comments

Comments
 (0)