Skip to content

Commit c84785d

Browse files
author
Ruben Schmidmeister
committed
Use raw strings
1 parent c724528 commit c84785d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/checkstyle.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use crate::rustfmt_diff::{DiffLine, Mismatch};
1010
/// future version of Rustfmt.
1111
pub(crate) fn header() -> String {
1212
let mut xml_heading = String::new();
13-
xml_heading.push_str("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
13+
xml_heading.push_str(r#"<?xml version="1.0" encoding="utf-8"?>"#);
1414
xml_heading.push_str("\n");
15-
xml_heading.push_str("<checkstyle version=\"4.3\">");
15+
xml_heading.push_str(r#"<checkstyle version="4.3">"#);
1616
xml_heading
1717
}
1818

@@ -32,16 +32,16 @@ pub(crate) fn output_checkstyle_file<T>(
3232
where
3333
T: Write,
3434
{
35-
write!(writer, "<file name=\"{}\">", filename.display())?;
35+
write!(writer, r#"<file name="{}">"#, filename.display())?;
3636
for mismatch in diff {
3737
for line in mismatch.lines {
3838
// Do nothing with `DiffLine::Context` and `DiffLine::Resulting`.
3939
if let DiffLine::Expected(message) = line {
4040
write!(
4141
writer,
42-
"<error line=\"{}\" severity=\"warning\" message=\"Should be `{}`\" \
43-
/>",
44-
mismatch.line_number, XmlEscaped(&message)
42+
r#"<error line="{}" severity="warning" message="Should be `{}`" />"#,
43+
mismatch.line_number,
44+
XmlEscaped(&message)
4545
)?;
4646
}
4747
}

0 commit comments

Comments
 (0)