Skip to content

Conversation

@farodin91
Copy link
Contributor

Fixes #39

@farodin91
Copy link
Contributor Author

We should merge it behind #36

Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome! I made a couple comments, but they're pretty minor.

Self { writer: writer }
}

#[cfg(test)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to rename this new_without_xml_declaration() or something similar? That way we can expose it to the user (if we want to) and it doesn't sound like we're making a special case simply for testing.

write!(self.parent.writer, "<")?;
key.serialize(&mut *self.parent)?;
write!(self.parent.writer, ">")?;
let key = key.serialize(&mut MapKeySerializer)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a very similar thing in #36 to detect whether something would be "wrapped" when serialized and mentioned we can use it to resolve this todo. I think it's a bit more general than your MapKeySerializer, so when #36 lands should we try to adapt this bit of code to use that?

To make WrapSafeDetector more useful, it could probably return an enum which represents roughly which type of thing something is (e.g. Kind::String, Kind::Complex, Kind::Numeric) with is_wrapped() being a helper method.

@TatriX
Copy link

TatriX commented Apr 10, 2018

Hi. What's the status of this?

@farodin91 farodin91 closed this Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serializing should use the XML library instead of printing strings

3 participants