Skip to content

Commit

Permalink
[errors] unified error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
spire-ffoston committed Feb 18, 2021
1 parent 1cc1295 commit b6a8f8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions validatron/src/validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ where
if *value == other {
Ok(())
} else {
Err(Error::new(format!("{} != {}", value, other)))
Err(Error::new(format!("'{}' must equal '{}'", value, other)))
}
}

Expand All @@ -52,7 +52,7 @@ where
R: Display,
{
if *value < min {
Err(Error::new(format!("{} is less than {}", value, min)))
Err(Error::new(format!("'{}' must be greater than or equal to '{}'", value, min)))
} else {
Ok(())
}
Expand Down Expand Up @@ -93,7 +93,7 @@ where
R: Display,
{
if *value > max {
Err(Error::new(format!("'{}' is greater than '{}'", value, max)))
Err(Error::new(format!("'{}' must be less than or equal to '{}'", value, max)))
} else {
Ok(())
}
Expand Down

0 comments on commit b6a8f8c

Please sign in to comment.