diff --git a/src/kv/value.rs b/src/kv/value.rs index 312232003..e8646b422 100644 --- a/src/kv/value.rs +++ b/src/kv/value.rs @@ -607,7 +607,7 @@ mod std_support { impl<'v> Value<'v> { /// Try convert this value into a string. - pub fn to_str(&self) -> Option> { + pub fn to_cow_str(&self) -> Option> { self.inner.to_str() } } @@ -894,12 +894,12 @@ pub(crate) mod tests { } #[test] - fn test_to_str() { + fn test_to_cow_str() { for v in str() { assert!(v.to_borrowed_str().is_some()); #[cfg(feature = "kv_unstable_std")] - assert!(v.to_str().is_some()); + assert!(v.to_cow_str().is_some()); } let short_lived = String::from("short lived"); @@ -908,13 +908,13 @@ pub(crate) mod tests { assert!(v.to_borrowed_str().is_some()); #[cfg(feature = "kv_unstable_std")] - assert!(v.to_str().is_some()); + assert!(v.to_cow_str().is_some()); for v in unsigned().chain(signed()).chain(float()).chain(bool()) { assert!(v.to_borrowed_str().is_none()); #[cfg(feature = "kv_unstable_std")] - assert!(v.to_str().is_none()); + assert!(v.to_cow_str().is_none()); } }