@@ -2,13 +2,10 @@ use super::{
2
2
consumed_object, never:: NeverEntity , Entity , EntityFactory , EnumeratedProperties ,
3
3
IteratedElements , ObjectEntity , ObjectPrototype , TypeofResult , ValueTrait ,
4
4
} ;
5
- use crate :: {
6
- analyzer:: Analyzer ,
7
- consumable:: { Consumable , ConsumableTrait } ,
8
- } ;
5
+ use crate :: { analyzer:: Analyzer , consumable:: Consumable } ;
9
6
use std:: fmt:: Debug ;
10
7
11
- trait BuiltinFnEntity < ' a > : ConsumableTrait < ' a > {
8
+ trait BuiltinFnEntity < ' a > : Debug {
12
9
#[ cfg( feature = "flame" ) ]
13
10
fn name ( & self ) -> & ' static str ;
14
11
fn object ( & self ) -> Option < & ' a ObjectEntity < ' a > > {
@@ -24,6 +21,12 @@ trait BuiltinFnEntity<'a>: ConsumableTrait<'a> {
24
21
}
25
22
26
23
impl < ' a , T : BuiltinFnEntity < ' a > > ValueTrait < ' a > for T {
24
+ fn consume ( & ' a self , analyzer : & mut Analyzer < ' a > ) {
25
+ if let Some ( object) = self . object ( ) {
26
+ object. consume ( analyzer) ;
27
+ }
28
+ }
29
+
27
30
fn unknown_mutate ( & ' a self , _analyzer : & mut Analyzer < ' a > , _dep : Consumable < ' a > ) {
28
31
// No effect
29
32
}
@@ -191,16 +194,6 @@ impl<'a, F: BuiltinFnImplementation<'a> + 'a> Debug for ImplementedBuiltinFnEnti
191
194
}
192
195
}
193
196
194
- impl < ' a , F : BuiltinFnImplementation < ' a > + ' a > ConsumableTrait < ' a >
195
- for ImplementedBuiltinFnEntity < ' a , F >
196
- {
197
- fn consume ( & self , analyzer : & mut Analyzer < ' a > ) {
198
- if let Some ( object) = self . object ( ) {
199
- object. consume ( analyzer) ;
200
- }
201
- }
202
- }
203
-
204
197
impl < ' a , F : BuiltinFnImplementation < ' a > + ' a > BuiltinFnEntity < ' a >
205
198
for ImplementedBuiltinFnEntity < ' a , F >
206
199
{
@@ -245,14 +238,6 @@ pub struct PureBuiltinFnEntity<'a> {
245
238
return_value : fn ( & EntityFactory < ' a > ) -> Entity < ' a > ,
246
239
}
247
240
248
- impl < ' a > ConsumableTrait < ' a > for PureBuiltinFnEntity < ' a > {
249
- fn consume ( & self , analyzer : & mut Analyzer < ' a > ) {
250
- if let Some ( object) = self . object ( ) {
251
- object. consume ( analyzer) ;
252
- }
253
- }
254
- }
255
-
256
241
impl < ' a > BuiltinFnEntity < ' a > for PureBuiltinFnEntity < ' a > {
257
242
#[ cfg( feature = "flame" ) ]
258
243
fn name ( & self ) -> & ' static str {
0 commit comments