diff --git a/src/term_id.rs b/src/term_id.rs index a9efa40..0a5484d 100644 --- a/src/term_id.rs +++ b/src/term_id.rs @@ -341,6 +341,15 @@ impl PartialEq for Prefix<'_> { } } +/// Prefix can be tested for equality with a `&str`. +/// +/// ``` +/// use ontolius::TermId; +/// +/// let term_id: TermId = "HP:0001250".parse().unwrap(); +/// +/// assert!(&term_id.prefix() == "HP"); +/// ``` impl PartialEq for Prefix<'_> { fn eq(&self, other: &str) -> bool { match &self.0 .0 {