mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
style: Cleanup a bit the counter style code.
Use more compact types, and remove some manual implementations that can be derived. Differential Revision: https://phabricator.services.mozilla.com/D31315
This commit is contained in:
parent
3034d66eef
commit
7d3997d7ef
2 changed files with 57 additions and 81 deletions
|
@ -288,7 +288,7 @@ impl CounterStyleOrNone {
|
|||
.0
|
||||
.iter()
|
||||
.map(|symbol| match *symbol {
|
||||
Symbol::String(ref s) => nsCStr::from(s),
|
||||
Symbol::String(ref s) => nsCStr::from(&**s),
|
||||
Symbol::Ident(_) => unreachable!("Should not have identifier in symbols()"),
|
||||
})
|
||||
.collect();
|
||||
|
@ -333,7 +333,7 @@ impl CounterStyleOrNone {
|
|||
let symbol_type = SymbolsType::from_gecko_keyword(anonymous.mSystem as u32);
|
||||
let symbols = symbols
|
||||
.iter()
|
||||
.map(|gecko_symbol| Symbol::String(gecko_symbol.to_string()))
|
||||
.map(|gecko_symbol| Symbol::String(gecko_symbol.to_string().into()))
|
||||
.collect();
|
||||
Either::First(CounterStyleOrNone::Symbols(symbol_type, Symbols(symbols)))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue