diff options
| author | Jakub Bukaj <jakub@jakub.cc> | 2014-11-16 10:21:42 +0100 |
|---|---|---|
| committer | Jakub Bukaj <jakub@jakub.cc> | 2014-11-16 10:21:42 +0100 |
| commit | 4c30cb25642d2cd4b228554e768068ba07504797 (patch) | |
| tree | ea124407c05314a1862322b1fccc28ac21a3ba09 /src/libserialize | |
| parent | 42c77f4958fcd6c2238d883c49f52341e0631999 (diff) | |
| parent | d82a7ea57a69954dcc9b58869907a0a070ef432d (diff) | |
| download | rust-4c30cb25642d2cd4b228554e768068ba07504797.tar.gz rust-4c30cb25642d2cd4b228554e768068ba07504797.zip | |
rollup merge of #18976: bjz/rfc369-numerics
Diffstat (limited to 'src/libserialize')
| -rw-r--r-- | src/libserialize/json.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 3018d7d8523..a074d6f43b9 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -200,7 +200,7 @@ use std::{char, f64, fmt, io, num, str}; use std::io::MemWriter; use std::mem::{swap, transmute}; use std::num::{Float, FPNaN, FPInfinite, Int}; -use std::str::ScalarValue; +use std::str::{FromStr, ScalarValue}; use std::string; use std::vec::Vec; use std::ops; @@ -1988,7 +1988,7 @@ macro_rules! read_primitive { String(s) => { // re: #12967.. a type w/ numeric keys (ie HashMap<uint, V> etc) // is going to have a string here, as per JSON spec. - match std::from_str::from_str(s.as_slice()) { + match std::str::from_str(s.as_slice()) { Some(f) => Ok(f), None => Err(ExpectedError("Number".to_string(), s)), } @@ -2027,7 +2027,7 @@ impl ::Decoder<DecoderError> for Decoder { String(s) => { // re: #12967.. a type w/ numeric keys (ie HashMap<uint, V> etc) // is going to have a string here, as per JSON spec. - match std::from_str::from_str(s.as_slice()) { + match std::str::from_str(s.as_slice()) { Some(f) => Ok(f), None => Err(ExpectedError("Number".to_string(), s)), } @@ -2399,7 +2399,7 @@ impl fmt::Show for Json { } } -impl std::from_str::FromStr for Json { +impl FromStr for Json { fn from_str(s: &str) -> Option<Json> { from_str(s).ok() } @@ -2484,7 +2484,7 @@ mod tests { #[test] fn test_from_str_trait() { let s = "null"; - assert!(::std::from_str::from_str::<Json>(s).unwrap() == from_str(s).unwrap()); + assert!(::std::str::from_str::<Json>(s).unwrap() == from_str(s).unwrap()); } #[test] |
