@@ -20,7 +20,6 @@ use gc_arena::{Gc, Mutation};
2020use indexmap:: IndexMap ;
2121use rand:: Rng ;
2222use ruffle_macros:: istr;
23- use std:: borrow:: Cow ;
2423use std:: cell:: Cell ;
2524use std:: cmp:: min;
2625use std:: fmt;
@@ -63,7 +62,7 @@ enum FrameControl<'gc> {
6362#[ derive( Clone ) ]
6463pub struct ActivationIdentifier < ' a > {
6564 parent : Option < & ' a ActivationIdentifier < ' a > > ,
66- name : Cow < ' static , str > ,
65+ name : & ' a str ,
6766 depth : u16 ,
6867 function_count : u16 ,
6968 special_count : u8 ,
@@ -75,36 +74,36 @@ impl fmt::Display for ActivationIdentifier<'_> {
7574 write ! ( f, "{parent} / " ) ?;
7675 }
7776
78- f. write_str ( & self . name ) ?;
77+ f. write_str ( self . name ) ?;
7978
8079 Ok ( ( ) )
8180 }
8281}
8382
8483impl < ' a > ActivationIdentifier < ' a > {
85- pub fn root < S : Into < Cow < ' static , str > > > ( name : S ) -> Self {
84+ pub fn root ( name : & ' a str ) -> Self {
8685 Self {
8786 parent : None ,
88- name : name . into ( ) ,
87+ name,
8988 depth : 0 ,
9089 function_count : 0 ,
9190 special_count : 0 ,
9291 }
9392 }
9493
95- pub fn child < S : Into < Cow < ' static , str > > > ( & ' a self , name : S ) -> Self {
94+ pub fn child ( & ' a self , name : & ' a str ) -> Self {
9695 Self {
9796 parent : Some ( self ) ,
98- name : name . into ( ) ,
97+ name,
9998 depth : self . depth + 1 ,
10099 function_count : self . function_count ,
101100 special_count : self . special_count ,
102101 }
103102 }
104103
105- pub fn function < ' gc , S : Into < Cow < ' static , str > > > (
104+ pub fn function < ' gc > (
106105 & ' a self ,
107- name : S ,
106+ name : & ' a str ,
108107 reason : ExecutionReason ,
109108 max_recursion_depth : u16 ,
110109 ) -> Result < Self , Error < ' gc > > {
@@ -124,7 +123,7 @@ impl<'a> ActivationIdentifier<'a> {
124123 } ;
125124 Ok ( Self {
126125 parent : Some ( self ) ,
127- name : name . into ( ) ,
126+ name,
128127 depth : self . depth + 1 ,
129128 function_count,
130129 special_count,
@@ -247,9 +246,9 @@ impl<'a, 'gc> Activation<'a, 'gc> {
247246 }
248247
249248 /// Create a new activation to run a block of code with a given scope.
250- pub fn with_new_scope < ' b , S : Into < Cow < ' static , str > > > (
249+ pub fn with_new_scope < ' b > (
251250 & ' b mut self ,
252- name : S ,
251+ name : & ' b str ,
253252 scope : Gc < ' gc , Scope < ' gc > > ,
254253 ) -> Activation < ' b , ' gc > {
255254 let id = self . id . child ( name) ;
@@ -329,9 +328,9 @@ impl<'a, 'gc> Activation<'a, 'gc> {
329328 }
330329
331330 /// Add a stack frame that executes code in timeline scope
332- pub fn run_child_frame_for_action < S : Into < Cow < ' static , str > > > (
331+ pub fn run_child_frame_for_action (
333332 & mut self ,
334- name : S ,
333+ name : & str ,
335334 active_clip : DisplayObject < ' gc > ,
336335 code : SwfSlice ,
337336 ) -> Result < ReturnType < ' gc > , Error < ' gc > > {
@@ -365,9 +364,9 @@ impl<'a, 'gc> Activation<'a, 'gc> {
365364 }
366365
367366 /// Add a stack frame that executes code in initializer scope.
368- pub fn run_with_child_frame_for_display_object < F , R , S : Into < Cow < ' static , str > > > (
367+ pub fn run_with_child_frame_for_display_object < F , R > (
369368 & mut self ,
370- name : S ,
369+ name : & str ,
371370 active_clip : DisplayObject < ' gc > ,
372371 swf_version : u8 ,
373372 function : F ,
0 commit comments