1 2 3 4 5 6 7 8 9
use crate::Error; pub fn validate(value: &str) -> Result<(), Error> { match value.len() { 0 => Err(Error::Empty), 1..=255 => Ok(()), _ => Err(Error::MaximumLengthExceeded), } }