defaults_demo/
defaults_demo.rs

1use derive_wizard::Wizard;
2
3#[derive(Debug, Wizard)]
4#[allow(unused)]
5struct UserProfile {
6    #[prompt("Enter your name:")]
7    name: String,
8
9    #[prompt("Enter your age:")]
10    age: u16,
11
12    #[prompt("Are you a developer?")]
13    is_developer: bool,
14}
15
16fn main() {
17    println!("=== Creating a new user profile ===");
18    let profile = UserProfile::wizard_builder().build();
19    println!("Created profile: {profile:#?}\n");
20
21    println!("=== Editing the existing profile ===");
22    println!("The current values will be pre-filled as defaults.");
23    let updated_profile = UserProfile::wizard_builder().with_defaults(profile).build();
24    println!("Updated profile: {updated_profile:#?}");
25}