Skip to main content

cannot_be_empty

Function cannot_be_empty 

Source
pub fn cannot_be_empty<C>(because: &'static str) -> impl Fn(&str, &C) -> Result
Available on crate feature validate only.
Expand description

A rule for a string that must not be empty. The because text gives the reason, so the message explains itself.

The message is “cannot be empty”, a dash, and because.

§Errors

The returned rule fails with that message when the string is empty.