Implement unwrapping method

This commit is contained in:
Benjamin Herman 2022-07-21 11:33:14 -07:00
parent cb57718f94
commit 02890e635c
No known key found for this signature in database
GPG key ID: A2D1938EC56DBF49
2 changed files with 9 additions and 0 deletions

View file

@ -65,6 +65,8 @@ fn main() {
// Any `Valid<Username>` passed is guaranteed
// to have met the arbitrary validation checks.
fn create_account(username: Valid<Username>) {
let username = username.into_inner(); // Unwrap
println!("Account {:?} created", username);
}
```