Skip to content

Commit

Permalink
update language in confirm.rs example for consistency with previous p…
Browse files Browse the repository at this point in the history
…rompts (#286)
  • Loading branch information
hirigaray authored Jan 4, 2025
1 parent 446ce3d commit aea4e60
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions inquire/examples/confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ fn main() {
message: "Are you happy?",
starting_input: None,
default: Some(false),
placeholder: Some("si|no"),
placeholder: Some("sim|não"),
help_message: Some("It's alright if you're not"),
formatter: &|ans| match ans {
true => "si".to_owned(),
false => "no".to_owned(),
true => "sim".to_owned(),
false => "não".to_owned(),
},
parser: &|ans| match ans {
"si" => Ok(true),
"no" => Ok(false),
"sim" => Ok(true),
"não" => Ok(false),
_ => Err(()),
},
error_message: "Reply with 'si' or 'no'".into(),
error_message: "Reply with 'sim' or 'não'".into(),
default_value_formatter: &|def| match def {
true => String::from("si"),
false => String::from("no"),
true => String::from("sim"),
false => String::from("não"),
},
render_config: RenderConfig::default(),
}
Expand Down

0 comments on commit aea4e60

Please sign in to comment.