-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
thread '<main>' panicked at 'called Result::unwrap()
on an Err
value: SyntaxError("expected value", 0, 0)'
#95
Comments
Sorry, it's my fault. The result can not map to |
No problem! Going through a impl serde::Deserialize for Vertex {
#[inline]
fn deserialize<D>(deserializer: &mut D) -> Result<Value, D::Error>
where D: serde::Deserializer,
let vertices: [f64, 16] = try!(serde::Deserialize::visit_seq(visitor));
Ok(Vertex {
position:[vertices[0], vertices[1],vertices[2]],
normal:[vertices[3], vertices[4], vertices[5]],
texcood:[vertices[6], vertices[7]],
blendweight:[vertices[8], vertices[9], vertices[10], vertices[11]],
blendindex:[vertices[12], vertices[13],vertices[14], vertices[15]]
})
}
} It might be possible to do away with that inner |
|
@linuxaged: Yeah I'm slowly adding more docs, but there's plenty more I need to do. You're right, I had a mistake, it really should be: impl serde::Deserialize for Vertex {
#[inline]
fn deserialize<D>(deserializer: &mut D) -> Result<Value, D::Error>
where D: serde::Deserializer,
let vertices: [f64, 16] = try!(serde::Deserialize::deserialize(deserializer));
Ok(Vertex {
position:[vertices[0], vertices[1],vertices[2]],
normal:[vertices[3], vertices[4], vertices[5]],
texcood:[vertices[6], vertices[7]],
blendweight:[vertices[8], vertices[9], vertices[10], vertices[11]],
blendindex:[vertices[12], vertices[13],vertices[14], vertices[15]]
})
}
} Sorry about that. |
Thanks for your support. |
@linuxaged: Unfortunately we can't do specialization like that yet. Since serde has an impl for |
For reference: RFC: impl specialization |
Added the power method for rational numbers
I written a serde example to do some deserializing, but got the error:
what has happened? How to debug this?
The text was updated successfully, but these errors were encountered: