- Json::I64(f) => {
- match num::cast(f) {
- Some(f) => Ok(f),
- None => Err(ExpectedError("Number".to_string(), format!("{}", f))),
- }
- }
- Json::U64(f) => {
- match num::cast(f) {
- Some(f) => Ok(f),
- None => Err(ExpectedError("Number".to_string(), format!("{}", f))),
- }
- }
- Json::F64(f) => {
- Err(ExpectedError("Integer".to_string(), format!("{}", f)))
- }
- Json::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::str::from_str(s.as_slice()) {
- Some(f) => Ok(f),
- None => Err(ExpectedError("Number".to_string(), s)),
- }
+ Json::I64(f) => match num::cast(f) {
+ Some(f) => Ok(f),
+ None => Err(ExpectedError("Number".to_string(), format!("{}", f))),
+ },
+ Json::U64(f) => match num::cast(f) {
+ Some(f) => Ok(f),
+ None => Err(ExpectedError("Number".to_string(), format!("{}", f))),
+ },
+ Json::F64(f) => Err(ExpectedError("Integer".to_string(), format!("{}", f))),
+ // re: #12967.. a type w/ numeric keys (ie HashMap<uint, V> etc)
+ // is going to have a string here, as per JSON spec.
+ Json::String(s) => match std::str::from_str(s.as_slice()) {
+ Some(f) => Ok(f),
+ None => Err(ExpectedError("Number".to_string(), s)),