Skip to content

Commit

Permalink
chore: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
roele committed Feb 1, 2024
1 parent bb53720 commit b7c600a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Run example with [`cargo run --example input`](./examples/input.rs).
use demand::Input;

fn main() {
let not_empty_min_8 = |s: &str| {
let notempty_minlen = |s: &str| {
if s.is_empty() {
return Err("Name cannot be empty");
}
Expand All @@ -35,7 +35,7 @@ fn main() {
.description("We'll use this to personalize your experience.")
.placeholder("Enter your name")
.prompt("Name: ")
.validate(not_empty_min_8);
.validation(notempty_minlen);
let i = t.run().expect("error running input");
println!("Input: {}", i);
}
Expand Down
4 changes: 2 additions & 2 deletions examples/input.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use demand::Input;

fn main() {
let not_empty_min_8 = |s: &str| {
let notempty_minlen = |s: &str| {
if s.is_empty() {
return Err("Name cannot be empty");
}
Expand All @@ -15,7 +15,7 @@ fn main() {
.description("We'll use this to personalize your experience.")
.placeholder("Enter your name")
.prompt("Name: ")
.validation(not_empty_min_8);
.validation(notempty_minlen);
let i = t.run().expect("error running input");
println!("Input: {}", i);
}

0 comments on commit b7c600a

Please sign in to comment.