summaryrefslogtreecommitdiffstats
path: root/src/value.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/value.rs')
-rw-r--r--src/value.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/value.rs b/src/value.rs
index ad173e8..82aef4c 100644
--- a/src/value.rs
+++ b/src/value.rs
@@ -20,10 +20,7 @@ impl<'a> Value<'a> {
/// Gets the underlying value as a string, performing a conversion only if neccessary.
pub fn as_str(&'a self) -> Option<Cow<'a, str>> {
if let Value::String(ref value) = *self {
- Some(match *value {
- Cow::Borrowed(v) => Cow::Borrowed(v),
- Cow::Owned(ref v) => Cow::Borrowed(v),
- })
+ Some(Cow::Borrowed(&*value))
} else if let Value::Integer(value) = *self {
Some(Cow::Owned(value.to_string()))
} else if let Value::Float(value) = *self {