Closed alpha-tango-kilo closed 1 year ago
Sample code:
let answer = Input::<String>::new() .with_prompt("What are you getting paid?") .with_initial_text("£") .default(Default::default()) .interact_text()?;
Input: press enter as soon as the prompt appears
Actual outcome:
assert_eq!("£", answer.as_str());
Suggested outcome:
assert_eq!("", answer.as_str());
Should be possible with a check for the input (before any type conversion) is equal to the initial text
Would you be open to a PR for this? I appreciate it's a behaviour change so could be considered breaking
It's intentional. Documentation has this line:
Sets initial text that user can accept or erase.
Sample code:
Input: press enter as soon as the prompt appears
Actual outcome:
Suggested outcome:
Should be possible with a check for the input (before any type conversion) is equal to the initial text
Would you be open to a PR for this? I appreciate it's a behaviour change so could be considered breaking