style: Remove the stupid space serialization on font-settings.

This commit is contained in:
Emilio Cobos Álvarez 2018-01-31 23:21:33 +01:00
parent 190e9b9715
commit 1380f1a14f
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 69 additions and 70 deletions

View file

@ -1444,7 +1444,7 @@ impl Clone for ${style_struct.gecko_struct_name} {
unsafe { current_settings.set_len_pod(other_settings.len() as u32) };
for (current, other) in current_settings.iter_mut().zip(other_settings) {
current.mTag = other.tag;
current.mTag = other.tag.0;
current.mValue = other.value.0;
}
}
@ -1470,7 +1470,7 @@ impl Clone for ${style_struct.gecko_struct_name} {
}
pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T {
use values::generics::{FontSettings, FontSettingTag, ${tag_type}} ;
use values::generics::{FontSettings, FontTag, FontSettingTag, ${tag_type}} ;
if self.gecko.mFont.${gecko_ffi_name}.len() == 0 {
FontSettings::Normal
@ -1478,7 +1478,7 @@ impl Clone for ${style_struct.gecko_struct_name} {
FontSettings::Tag(
self.gecko.mFont.${gecko_ffi_name}.iter().map(|gecko_font_setting| {
FontSettingTag {
tag: gecko_font_setting.mTag,
tag: FontTag(gecko_font_setting.mTag),
value: ${tag_type}(gecko_font_setting.mValue),
}
}).collect()

View file

@ -54,6 +54,7 @@ use values::distance::{ComputeSquaredDistance, SquaredDistance};
#[cfg(feature = "gecko")] use values::generics::FontSettings as GenericFontSettings;
#[cfg(feature = "gecko")] use values::generics::FontSettingTag as GenericFontSettingTag;
#[cfg(feature = "gecko")] use values::generics::FontSettingTagFloat;
#[cfg(feature = "gecko")] use values::generics::FontTag;
use values::generics::NonNegative;
use values::generics::effects::Filter;
use values::generics::position as generic_position;
@ -878,7 +879,7 @@ type FontSettingTag = GenericFontSettingTag<FontSettingTagFloat>;
struct FontSettingTagIterState<'a> {
tags: Vec<(&'a FontSettingTag)>,
index: usize,
prev_tag: u32,
prev_tag: FontTag,
}
#[cfg(feature = "gecko")]
@ -887,7 +888,7 @@ impl<'a> FontSettingTagIterState<'a> {
FontSettingTagIterState {
index: tags.len(),
tags,
prev_tag: 0,
prev_tag: FontTag(0),
}
}
}
@ -941,7 +942,7 @@ impl<'a> FontSettingTagIter<'a> {
fn as_new_sorted_tags(tags: &Vec<FontSettingTag>) -> Vec<(&FontSettingTag)> {
use std::iter::FromIterator;
let mut sorted_tags: Vec<(&FontSettingTag)> = Vec::from_iter(tags.iter());
sorted_tags.sort_by_key(|k| k.tag);
sorted_tags.sort_by_key(|k| k.tag.0);
sorted_tags
};