Skip to content

Commit

Permalink
readline: remove validator
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Feb 11, 2024
1 parent 3c5405f commit 27b4bf0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions examples/readline.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
use promkit::{error::Result, preset::Readline};

fn main() -> Result {
let mut p = Readline::default()
.title("Feel free to fill in")
.validator(
|text| text.len() > 10,
|text| format!("Length must be over 10 but got {}", text.len()),
)
.prompt()?;
let mut p = Readline::default().title("Feel free to fill in").prompt()?;
println!("result: {:?}", p.run()?);
Ok(())
}

0 comments on commit 27b4bf0

Please sign in to comment.