Skip to content

Commit

Permalink
fixes to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 4, 2024
1 parent d70e9fa commit 1bee878
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ let exposed_value = secret.expose_secret(|exposed_secret| {
});
```
Note: You can use the non-panicking variant of the method `expose_secret(...)` which is named as `try_expose_secret(...)`. `try_expose_secret(...)` returns an `Result::Err` if the exposure count is larger than what is maximally allowed.
Note: You can use the non-panicking variant of the method `expose_secret(...)` which is named as `try_expose_secret(...)`.
`try_expose_secret(...)` returns a `Result::Err` if the exposure count is larger than what is maximally allowed.
It is **impossible** to return the value (e.g. `exposed_secret` in the example above) passed into the closure, out of the closure, **unless** `T` is `Copy`. The following is uncompilable.
Expand All @@ -171,7 +173,6 @@ use sosecrets_rs::{
// Note, for runtime checks, you have to use the `RTExposeSecret` trait instead.
runtime::traits::RTExposeSecret,
};
use typenum::U2;
// Define a secret with NO maximum exposure count
let secret = SecrecySecret::new("my_secret_value".to_string());
Expand Down

0 comments on commit 1bee878

Please sign in to comment.