Bug 1457635: Remove values::Verbatim. r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 29 Apr 2018 05:34:28 +0200
changeset 472335 3eb5075978e313bc6980a44a615863e479b68c05
parent 472334 bfee15c5c84566738fc99380e55cb9de56d619ba
child 472336 f9fc7f957bb2e648f47a7e2b252b8aa66ca7e960
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1457635
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1457635: Remove values::Verbatim. r=xidorn No point of having two things that do the same. MozReview-Commit-ID: Do1L4bvOeVQ
servo/components/style_derive/to_css.rs
servo/components/style_traits/values.rs
--- a/servo/components/style_derive/to_css.rs
+++ b/servo/components/style_derive/to_css.rs
@@ -170,17 +170,17 @@ fn derive_single_field_expr(
     where_clause: &mut Option<WhereClause>,
 ) -> Tokens {
     let mut expr = if attrs.iterable {
         if let Some(if_empty) = attrs.if_empty {
             return quote! {
                 {
                     let mut iter = #field.iter().peekable();
                     if iter.peek().is_none() {
-                        writer.item(&::style_traits::values::Verbatim(#if_empty))?;
+                        writer.raw_item(#if_empty)?;
                     } else {
                         for item in iter {
                             writer.item(&item)?;
                         }
                     }
                 }
             };
         }
--- a/servo/components/style_traits/values.rs
+++ b/servo/components/style_traits/values.rs
@@ -230,31 +230,16 @@ where
     ///
     /// See SequenceWriter::item.
     #[inline]
     pub fn raw_item(&mut self, item: &str) -> fmt::Result {
         self.write_item(|inner| inner.write_str(item))
     }
 }
 
-/// A wrapper type that implements `ToCss` by printing its inner field.
-pub struct Verbatim<'a, T>(pub &'a T)
-where
-    T: ?Sized + 'a;
-
-impl<'a, T> ToCss for Verbatim<'a, T>
-where
-    T: AsRef<str> + ?Sized + 'a,
-{
-    #[inline]
-    fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: Write {
-        dest.write_str(self.0.as_ref())
-    }
-}
-
 /// Type used as the associated type in the `OneOrMoreSeparated` trait on a
 /// type to indicate that a serialized list of elements of this type is
 /// separated by commas.
 pub struct Comma;
 
 /// Type used as the associated type in the `OneOrMoreSeparated` trait on a
 /// type to indicate that a serialized list of elements of this type is
 /// separated by spaces.