Just some small things that were missed during initial implementation, but are needed to fully replace dialoguer
.
XX6GKS5DCDFNIEEAPY2ACYYIWMHA4BGHYUQYQIZBR6IV2OYGNDIAC
if let Some(default) = self.default.as_mut() {
let default = if let Some(initial_value) = &self.initial_value {
Some(initial_value.clone())
} else if let Some(default) = &self.default {
Some(default.clone())
} else {
None
};
if let Some(default) = default {
/// Sets if no input is a valid input. Default: `false`.
pub fn set_allow_empty(&mut self, empty: bool) {
self.0.allow_empty(empty);
}
/// Builder pattern for [`Self::set_allow_empty`]
pub fn with_allow_empty(&mut self, empty: bool) -> &mut Self {
self.set_allow_empty(empty);
self
}
impl Input {
pub fn set_inital_text<S: ToString>(&mut self, text: S) {
self.0.set_inital_text(text.to_string());
}
pub fn with_initial_text<S: ToString>(&mut self, text: S) -> &mut Self {
self.set_inital_text(text);
self
}
}