-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add convenience function for parsing common forms of booleans #44
Comments
This is expected. You should use fn foo<'de, D>(d: D) -> Result<T, D::Error> where D: Deserializer<'de> {
let s = String::deserialize(d)?;
match &s[..] {
"true" => Ok(true),
"false" => Ok(false),
other => Err(D::Error::custom(format!("got {}, but expected `true` or `false`", other))),
}
} |
The main issue was possibly because of a change in the implementation of serde-rs or serde-xml-rs and the details are here: RReverser/serde-xml-rs#44
@oli-obk Should this work with the next version. |
No. This is a can of worms that we do not want to open (see #18). We can offer the function |
I though of this test https://github.com/RReverser/serde-xml-rs/blob/master/tests/migrated.rs#L342-L349 |
Huh? How is that test passing? |
So it works as a root element but not a field? |
Something like |
The rust-s3 project was apparently working fine before and could parse this xml: <ListBucketResult
xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>RelationalAI</Name>
<Prefix>/</Prefix>
<KeyCount>0</KeyCount>
<MaxKeys>1000</MaxKeys>
<IsTruncated>true</IsTruncated>
</ListBucketResult> But, it does not work now, and it might be because of some recent changes in your codebase. |
@mdashti serde-xml-rs definitely didn't support that format, it's rather because it switched from serde-xml to serde-xml-rs in rust-s3 in durch/rust-s3@2f684e2 |
The main issue was possibly because of a change in the implementation of serde-rs or serde-xml-rs and the details are here: RReverser/serde-xml-rs#44
Hi all,
I have the following (minimized) program:
And the result of running it is:
I am using rustc 1.20.0 (f3d6973f4 2017-08-27) and my sample project is in test_proj.zip.
Can anyone help me to solve the issue?
The text was updated successfully, but these errors were encountered: