mirror of
https://github.com/servo/servo
synced 2026-05-13 18:37:30 +02:00
style: Use function pointer rather than Fn trait object for collect_property_completion_keywords.
Differential Revision: https://phabricator.services.mozilla.com/D2985
This commit is contained in:
committed by
Emilio Cobos Álvarez
parent
c77ecd6984
commit
f14a3edd7d
@@ -603,16 +603,17 @@ impl NonCustomPropertyId {
|
||||
|
||||
/// See PropertyId::collect_property_completion_keywords.
|
||||
fn collect_property_completion_keywords(&self, f: KeywordsCollectFn) {
|
||||
const COLLECT_FUNCTIONS: [&Fn(KeywordsCollectFn);
|
||||
fn do_nothing(_: KeywordsCollectFn) {}
|
||||
const COLLECT_FUNCTIONS: [fn(KeywordsCollectFn);
|
||||
${len(data.longhands) + len(data.shorthands)}] = [
|
||||
% for prop in data.longhands:
|
||||
&<${prop.specified_type()} as SpecifiedValueInfo>::collect_completion_keywords,
|
||||
<${prop.specified_type()} as SpecifiedValueInfo>::collect_completion_keywords,
|
||||
% endfor
|
||||
% for prop in data.shorthands:
|
||||
% if prop.name == "all":
|
||||
&|_f| {}, // 'all' accepts no value other than CSS-wide keywords
|
||||
do_nothing, // 'all' accepts no value other than CSS-wide keywords
|
||||
% else:
|
||||
&<shorthands::${prop.ident}::Longhands as SpecifiedValueInfo>::
|
||||
<shorthands::${prop.ident}::Longhands as SpecifiedValueInfo>::
|
||||
collect_completion_keywords,
|
||||
% endif
|
||||
% endfor
|
||||
|
||||
Reference in New Issue
Block a user