Skip to content

Commit

Permalink
Rename XmlWriteOptions method to match other methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarnard committed Jan 16, 2023
1 parent 09fc0f9 commit b62b3ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl XmlWriteOptions {
let indent_str = indent_str.as_ref();

if indent_str.is_empty() {
return self.with_indent(0, 0);
return self.indent(0, 0);
}

assert!(
Expand All @@ -120,13 +120,13 @@ impl XmlWriteOptions {
"indent str must consist of a single repeating character"
);

self.with_indent(indent_str[0], indent_str.len())
self.indent(indent_str[0], indent_str.len())
}

/// Specifies the character and amount used for indentation.
///
/// The default is indenting with a single tab.
pub fn with_indent(mut self, indent_char: u8, indent_amount: usize) -> Self {
pub fn indent(mut self, indent_char: u8, indent_amount: usize) -> Self {
self.indent_char = indent_char;
self.indent_amount = indent_amount;
self
Expand Down
6 changes: 3 additions & 3 deletions src/stream/xml_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,12 @@ mod tests {
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<array>
.<string>It is a tale told by an idiot,</string>
.<string>Full of sound and fury, signifying nothing.</string>
...<string>It is a tale told by an idiot,</string>
...<string>Full of sound and fury, signifying nothing.</string>
</array>
</plist>";

let actual = events_to_xml(plist, XmlWriteOptions::default().with_indent(b'.', 1));
let actual = events_to_xml(plist, XmlWriteOptions::default().indent(b'.', 3));

assert_eq!(actual, expected);
}
Expand Down

0 comments on commit b62b3ad

Please sign in to comment.