replace match by if let statements if possible

This commit is contained in:
Julien Levesy 2016-12-30 17:17:21 +01:00
parent 608511ddc3
commit b78979d692
7 changed files with 39 additions and 58 deletions

View file

@ -393,9 +393,8 @@ impl Shaper {
fn advance_for_shaped_glyph(&self, mut advance: Au, character: char, options: &ShapingOptions)
-> Au {
match options.letter_spacing {
None => {}
Some(letter_spacing) => advance = advance + letter_spacing,
if let Some(letter_spacing) = options.letter_spacing {
advance = advance + letter_spacing;
};
// CSS 2.1 § 16.4 states that "word spacing affects each space (U+0020) and non-breaking