diff options
author | Jonathan Kew <jkew@mozilla.com> | 2023-01-29 22:01:28 +0000 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-11-06 09:35:57 +0100 |
commit | 8a2cfc0b24994daead399faec9f0341199b6614c (patch) | |
tree | a1e8077afbb56576103ce0e15c08081e68c69d9b /components/style/servo | |
parent | 05fb1b62b7566c9c1155a05680f2e9d9a670e874 (diff) | |
download | servo-8a2cfc0b24994daead399faec9f0341199b6614c.tar.gz servo-8a2cfc0b24994daead399faec9f0341199b6614c.zip |
style: Use write_char in place of write_str when serializing single-character literals
Generated by running
find servo/components/style -name "*.rs" -exec perl -p -i -e "s/write_str\(\"(.)\"\)/write_char('\1')/g" {} \;
(and then added `use std::fmt::Write;` in a couple of places to fix build errors that arose).
Differential Revision: https://phabricator.services.mozilla.com/D168217
Diffstat (limited to 'components/style/servo')
-rw-r--r-- | components/style/servo/selector_parser.rs | 2 | ||||
-rw-r--r-- | components/style/servo/url.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/components/style/servo/selector_parser.rs b/components/style/servo/selector_parser.rs index 901ef71071e..08431dba684 100644 --- a/components/style/servo/selector_parser.rs +++ b/components/style/servo/selector_parser.rs @@ -337,7 +337,7 @@ impl ToCss for NonTSPseudoClass { if let Lang(ref lang) = *self { dest.write_str(":lang(")?; serialize_identifier(lang, dest)?; - return dest.write_str(")"); + return dest.write_char(')'); } dest.write_str(match *self { diff --git a/components/style/servo/url.rs b/components/style/servo/url.rs index f4ae4e25edf..2186be7aabd 100644 --- a/components/style/servo/url.rs +++ b/components/style/servo/url.rs @@ -158,7 +158,7 @@ impl ToCss for CssUrl { dest.write_str("url(")?; string.to_css(dest)?; - dest.write_str(")") + dest.write_char(')') } } @@ -230,7 +230,7 @@ impl ToCss for ComputedUrl { dest.write_str("url(")?; string.to_css(dest)?; - dest.write_str(")") + dest.write_char(')') } } |