Open wellcaffeinated opened 5 days ago
Since type Validator<T> = fn(&T) -> bool;, i can't do something like:
type Validator<T> = fn(&T) -> bool;
let existing_filenames = read_dir(...); Readline::default() .title("Name new file:") .validator(|name| !existing_filenames.contains(name.to_string()), |name| format!("File {} already exists", name)) .prompt()? .run()?;
Suggest swapping this to something like type Validator<T> = Box<dyn Fn(&T) -> bool>;
type Validator<T> = Box<dyn Fn(&T) -> bool>;
Since
type Validator<T> = fn(&T) -> bool;
, i can't do something like:Suggest swapping this to something like
type Validator<T> = Box<dyn Fn(&T) -> bool>;