use crate::StringTyped;
#[must_use]
pub fn is_valid(label: &str) -> bool {
label.trim() == label && label.as_bytes().first() != Some(&b'/')
}
#[must_use]
pub fn is_empty(label: &str) -> bool {
debug_assert!(is_valid(label));
label.is_empty()
}
pub trait Label: StringTyped + Default + PartialEq + Ord {
#[must_use]
fn is_valid(&self) -> bool {
is_valid(self.as_ref())
}
#[must_use]
fn is_empty(&self) -> bool {
is_empty(self.as_ref())
}
}
impl<T> Label for T where T: StringTyped + Default + PartialEq + Ord {}