Turns out I was wrong, the @size helper attempts to cast to a number regardless of the input and it uses that. Fixed the test.

This commit is contained in:
Tom Alexander
2020-06-14 15:20:54 -04:00
parent e70f397545
commit 648ae5dfdb
4 changed files with 30 additions and 32 deletions

View File

@@ -353,6 +353,10 @@ impl Castable for serde_json::Value {
})
.ok(),
(serde_json::Value::Number(_), "number") => Some(IceResult::from_borrowed(self)),
(serde_json::Value::Null, "number") => None,
(serde_json::Value::Bool(_), "number") => None,
(serde_json::Value::Array(_), "number") => None,
(serde_json::Value::Object(_), "number") => None,
(_, _) => panic!("Unimplemented cast"),
}
}