Skip to content

Commit cf616b4

Browse files
secrecy: impl Default for SecretString (#1232)
Closes #1228
1 parent 2835a08 commit cf616b4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

secrecy/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ impl Clone for SecretString {
205205
}
206206
}
207207

208+
impl Default for SecretString {
209+
fn default() -> SecretString {
210+
String::default().into()
211+
}
212+
}
213+
208214
/// Marker trait for secrets which are allowed to be cloned
209215
pub trait CloneableSecret: Clone + Zeroize {}
210216

0 commit comments

Comments
 (0)