File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
core/src/avm2/globals/flash/text Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use crate::avm2::error::make_error_1508;
55use crate :: avm2:: object:: FontObject ;
66use crate :: avm2:: parameters:: ParametersExt ;
77use crate :: avm2:: value:: Value ;
8- use crate :: avm2:: { ArrayObject , ArrayStorage , Error } ;
8+ use crate :: avm2:: { ArrayObject , Error } ;
99use crate :: avm2_stub_method;
1010use crate :: string:: AvmString ;
1111
@@ -133,10 +133,11 @@ pub fn enumerate_fonts<'gc>(
133133 } ) ;
134134
135135 let font_class = activation. avm2 ( ) . classes ( ) . font ;
136- let mut storage = ArrayStorage :: new ( fonts. len ( ) ) ;
137- for font in fonts {
138- storage. push ( FontObject :: for_font ( activation. gc ( ) , font_class, font) . into ( ) ) ;
139- }
136+ let storage = fonts
137+ . into_iter ( )
138+ . map ( |font| FontObject :: for_font ( activation. gc ( ) , font_class, font) )
139+ . collect ( ) ;
140+
140141 Ok ( ArrayObject :: from_storage ( activation, storage) . into ( ) )
141142}
142143
You can’t perform that action at this time.
0 commit comments