use secure_types::SecureString;
fn main() {
let exposed_string = String::from("my_secret");
let mut secure_string = SecureString::from(exposed_string);
secure_string.unlock_str(|unlocked_str| {
assert_eq!(unlocked_str, "my_secret");
println!("The secret is: {}", unlocked_str);
});
secure_string.push_str("_password");
secure_string.unlock_str(|unlocked_str| {
assert_eq!(unlocked_str, "my_secret_password");
println!("The secret is: {}", unlocked_str);
});
}