style: Update style to arrayvec 0.7

Differential Revision: https://phabricator.services.mozilla.com/D147476
This commit is contained in:
Mike Hommey 2023-08-15 01:05:17 +02:00 committed by Martin Robinson
parent 7bc667f6b4
commit 036b067d65

View file

@ -2593,9 +2593,11 @@ impl PropertyDeclaration {
} }
} }
type SubpropertiesVec<T> = ArrayVec<T, ${max(len(s.sub_properties) \ const SUB_PROPERTIES_ARRAY_CAP: usize =
for s in data.shorthands_except_all()) \ ${max(len(s.sub_properties) for s in data.shorthands_except_all()) \
if data.shorthands_except_all() else 0}>; if data.shorthands_except_all() else 0};
type SubpropertiesVec<T> = ArrayVec<T, SUB_PROPERTIES_ARRAY_CAP>;
/// A stack-allocated vector of `PropertyDeclaration` /// A stack-allocated vector of `PropertyDeclaration`
/// large enough to parse one CSS `key: value` declaration. /// large enough to parse one CSS `key: value` declaration.
@ -2655,11 +2657,7 @@ impl SourcePropertyDeclaration {
/// Return type of SourcePropertyDeclaration::drain /// Return type of SourcePropertyDeclaration::drain
pub struct SourcePropertyDeclarationDrain<'a> { pub struct SourcePropertyDeclarationDrain<'a> {
declarations: ArrayVecDrain< declarations: ArrayVecDrain<'a, PropertyDeclaration, SUB_PROPERTIES_ARRAY_CAP>,
'a, PropertyDeclaration,
${max(len(s.sub_properties) for s in data.shorthands_except_all()) \
if data.shorthands_except_all() else 0}
>,
all_shorthand: AllShorthand, all_shorthand: AllShorthand,
} }