Function yn::no [−][src]
pub fn no(
string: impl Display
) -> bool
Determines if a value is a form of no.
Returns true when the value is and/or contains (see examples for clarification) "n"
, "no"
, false
or 0
.
Examples
no should be no:
assert!(yn::no("n")); assert!(yn::no("no")); assert!(yn::no("false false false VERY false")); assert!(yn::no("double up to make sure, no no n n false FALSE!! 0 0 !! AAARGGHH")); assert!(yn::no("definitely no hhhrrrghhh *barks loudly*"));
should definitely not be no:
assert!(!yn::no("yes")); assert!(!yn::no("this is definitely a yes.")); assert!(!yn::no("true"));