aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-27 19:29:58 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-27 19:29:58 -0800
commit482752b5f4c7bbb3e1b5fce28ec67720912ffb51 (patch)
tree6ccad51d7458b41d37619a8fdd42d2a176224a3f /src/lib.rs
parent909a85069b866ab7384eda20a3ff7d751d8c2235 (diff)
downloadmilf-rs-482752b5f4c7bbb3e1b5fce28ec67720912ffb51.tar.gz
milf-rs-482752b5f4c7bbb3e1b5fce28ec67720912ffb51.zip
Migrate to as many stable functions as possible
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index bbe13d1..b24d264 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -38,7 +38,7 @@
#![deny(missing_docs)]
#![cfg_attr(test, deny(warnings))]
-#![allow(unstable)]
+#![cfg_attr(test, allow(unstable))]
extern crate "rustc-serialize" as rustc_serialize;
@@ -111,7 +111,7 @@ impl Value {
/// Extracts the string of this value if it is a string.
pub fn as_str<'a>(&'a self) -> Option<&'a str> {
- match *self { Value::String(ref s) => Some(s.as_slice()), _ => None }
+ match *self { Value::String(ref s) => Some(&**s), _ => None }
}
/// Extracts the integer value if it is an integer.
@@ -138,12 +138,12 @@ impl Value {
/// 1979-05-27T07:32:00Z
/// ```
pub fn as_datetime<'a>(&'a self) -> Option<&'a str> {
- match *self { Value::Datetime(ref s) => Some(s.as_slice()), _ => None }
+ match *self { Value::Datetime(ref s) => Some(&**s), _ => None }
}
/// Extracts the array value if it is an array.
pub fn as_slice<'a>(&'a self) -> Option<&'a [Value]> {
- match *self { Value::Array(ref s) => Some(s.as_slice()), _ => None }
+ match *self { Value::Array(ref s) => Some(&**s), _ => None }
}
/// Extracts the table value if it is a table.