-
Notifications
You must be signed in to change notification settings - Fork 38
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
Document to string with save options #59
Conversation
src/tree/document.rs
Outdated
@@ -171,26 +213,51 @@ impl Document { | |||
} | |||
|
|||
/// Serializes the `Document` | |||
pub fn to_string(&self, format: bool) -> String { | |||
pub fn to_string(&self) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can entirely remove the to_string
definition here, it is auto-generated by the fmt::Display
implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
(*xml_indent_tree_output_ptr) = indent; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent to see this removed, thanks!
Thanks @jangernert ! This looks good to merge after you simply delete the explicit |
Thanks, glad to have the upgrade! |
Cool! Happy to help. |
xmlSaveOption
:to_string_with_options
to_string
since it is covered by the new methodcargo fmt
and can be reverted if needed