-
Notifications
You must be signed in to change notification settings - Fork 26
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
[feature] update to 'minidom:0.13.0' #746
Conversation
ffec3d1
to
8438550
Compare
@@ -120,6 +120,13 @@ fn only_alphanumeric(s: &str) -> String { | |||
s.chars().filter(|c| c.is_alphanumeric()).collect() | |||
} | |||
|
|||
fn write_file(filepath: &PathBuf, netex: Element) -> Result<()> { | |||
let file = File::create(filepath)?; | |||
let mut writer = minidom::quick_xml::Writer::new_with_indent(file, b'\t', 1); |
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.
I would also like to propose the following modification to avoid indented XML files in release mode.
let mut writer = minidom::quick_xml::Writer::new_with_indent(file, b'\t', 1); | |
#[cfg(debug_assertions)] | |
let mut writer = minidom::quick_xml::Writer::new_with_indent(file, b'\t', 1); | |
#[cfg(not(debug_assertions))] | |
let mut writer = minidom::quick_xml::Writer::new(file); |
[patch.crates-io] | ||
minidom_ext = { git = "https://github.com/CanalTP/minidom_ext", branch = "minidom-0.13" } |
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.
This has to be removed before merging.
|
This PR depends on hove-io/minidom_ext#6.
I'm removing entirely the dependence on
minidom_writer
and uses the already available APIs fromminidom
in order to write XML files. A few modifications to the fixtures had to be done but their only formatting differences, not semantic.I also removed
quick_xml
fromCargo.toml
(see hove-io/minidom_ext#6 for the explanation).