Conversation
|
Thanks for the pr! But we cannot add |
|
Ok, it's trickier than I thought. We may need to introduce a new trait |
|
Henlo, can you tell me what was wrong with my PR, for educational purposes? |
|
Actually, it seems like your version doesn't do the same thing.
Is this about attribute types only requiring string conversions rather than Xml conversions? |
I'm afraid it doesn't work either. You can use use strong_xml::{XmlRead, XmlResult, XmlReader};
struct Foo;
impl XmlRead<'static> for Foo {
fn from_reader(_: &mut XmlReader<'static>) -> XmlResult<Foo> {
Ok(Foo)
}
}
fn main() {
let _ = Foo::from_str("");
let s = String::new();
let _ = Foo::from_str(s.as_str());
}
Indeed, they only need to be bound by
Thanks for pointing out. Actually, I haven't tried it before and looks like serde is smart enough to determine which felids should be bound. I'm going to reopen this issue. But it'll probably take some time to implement. Feel free to update this pr if you have any idea about the implementation. |
I actually made this on top of v5.0, because
masteris currently kill for me.But the change is outside the
impl_xfunctions, so it might just merge.Does this need any tests?