diff --git a/crates/uv-normalize/src/extra_name.rs b/crates/uv-normalize/src/extra_name.rs index 6341ff7fe..f23431178 100644 --- a/crates/uv-normalize/src/extra_name.rs +++ b/crates/uv-normalize/src/extra_name.rs @@ -23,6 +23,11 @@ impl ExtraName { pub fn new(name: String) -> Result { validate_and_normalize_owned(name).map(Self) } + + /// Return the underlying extra name as a string. + pub fn as_str(&self) -> &str { + &self.0 + } } impl FromStr for ExtraName { @@ -51,6 +56,6 @@ impl Display for ExtraName { impl AsRef for ExtraName { fn as_ref(&self) -> &str { - &self.0 + self.as_str() } }