Skip to content

Commit 478f970

Browse files
committed
chore: Appease clippy
1 parent d7532ae commit 478f970

File tree

4 files changed

+84
-85
lines changed

4 files changed

+84
-85
lines changed

core/src/avm1/function.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -860,13 +860,13 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
860860
macro_rules! constructor_to_fn {
861861
($f:expr) => {{
862862
fn _constructor_fn<'gc>(
863-
activation: &mut crate::avm1::activation::Activation<'_, 'gc, '_>,
864-
this: crate::avm1::Object<'gc>,
865-
args: &[crate::avm1::Value<'gc>],
866-
) -> Result<crate::avm1::Value<'gc>, crate::avm1::error::Error<'gc>> {
863+
activation: &mut $crate::avm1::activation::Activation<'_, 'gc, '_>,
864+
this: $crate::avm1::Object<'gc>,
865+
args: &[$crate::avm1::Value<'gc>],
866+
) -> Result<$crate::avm1::Value<'gc>, $crate::avm1::error::Error<'gc>> {
867867
let _ = $f(activation, this, args)?;
868-
Ok(crate::avm1::Value::Undefined)
868+
Ok($crate::avm1::Value::Undefined)
869869
}
870-
crate::avm1::function::Executable::Native(_constructor_fn)
870+
$crate::avm1::function::Executable::Native(_constructor_fn)
871871
}};
872872
}

core/src/avm1/object/custom_object.rs

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[macro_export]
22
macro_rules! impl_custom_object {
33
($field:ident) => {
4-
crate::impl_custom_object!($field {});
4+
$crate::impl_custom_object!($field {});
55
};
66

77
(@extra $field:ident bare_object($as_obj:ident -> $obj_type:ident :: $new:ident)) => {
@@ -11,9 +11,9 @@ macro_rules! impl_custom_object {
1111

1212
fn create_bare_object(
1313
&self,
14-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
15-
this: crate::avm1::Object<'gc>,
16-
) -> Result<crate::avm1::Object<'gc>, crate::avm1::Error<'gc>> {
14+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
15+
this: $crate::avm1::Object<'gc>,
16+
) -> Result<$crate::avm1::Object<'gc>, $crate::avm1::Error<'gc>> {
1717
Ok($obj_type::$new(activation.context.gc_context, Some(this)).into())
1818
}
1919
};
@@ -24,34 +24,34 @@ macro_rules! impl_custom_object {
2424
)*
2525
}) => {
2626
$(
27-
crate::impl_custom_object!(@extra $field $extra_name($($extra)*));
27+
$crate::impl_custom_object!(@extra $field $extra_name($($extra)*));
2828
)*
2929

3030
fn get_local_stored(
3131
&self,
32-
name: impl Into<crate::avm1::AvmString<'gc>>,
33-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
34-
) -> Option<crate::avm1::Value<'gc>> {
32+
name: impl Into<$crate::avm1::AvmString<'gc>>,
33+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
34+
) -> Option<$crate::avm1::Value<'gc>> {
3535
self.0.read().$field.get_local_stored(name, activation)
3636
}
3737

3838
fn set_local(
3939
&self,
40-
name: crate::avm1::AvmString<'gc>,
41-
value: crate::avm1::Value<'gc>,
42-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
43-
this: crate::avm1::Object<'gc>,
44-
) -> Result<(), crate::avm1::Error<'gc>> {
40+
name: $crate::avm1::AvmString<'gc>,
41+
value: $crate::avm1::Value<'gc>,
42+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
43+
this: $crate::avm1::Object<'gc>,
44+
) -> Result<(), $crate::avm1::Error<'gc>> {
4545
self.0.read().$field.set_local(name, value, activation, this)
4646
}
4747

4848
fn call(
4949
&self,
50-
name: crate::avm1::AvmString<'gc>,
51-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
52-
this: crate::avm1::Value<'gc>,
53-
args: &[crate::avm1::Value<'gc>],
54-
) -> Result<crate::avm1::Value<'gc>, crate::avm1::Error<'gc>> {
50+
name: $crate::avm1::AvmString<'gc>,
51+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
52+
this: $crate::avm1::Value<'gc>,
53+
args: &[$crate::avm1::Value<'gc>],
54+
) -> Result<$crate::avm1::Value<'gc>, $crate::avm1::Error<'gc>> {
5555
self.0
5656
.read()
5757
.$field
@@ -60,38 +60,38 @@ macro_rules! impl_custom_object {
6060

6161
fn getter(
6262
&self,
63-
name: crate::avm1::AvmString<'gc>,
64-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
65-
) -> Option<crate::avm1::object::Object<'gc>> {
63+
name: $crate::avm1::AvmString<'gc>,
64+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
65+
) -> Option<$crate::avm1::object::Object<'gc>> {
6666
self.0.read().$field.getter(name, activation)
6767
}
6868

6969
fn setter(
7070
&self,
71-
name: crate::avm1::AvmString<'gc>,
72-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
73-
) -> Option<crate::avm1::object::Object<'gc>> {
71+
name: $crate::avm1::AvmString<'gc>,
72+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
73+
) -> Option<$crate::avm1::object::Object<'gc>> {
7474
self.0.read().$field.setter(name, activation)
7575
}
7676

7777
fn delete(
7878
&self,
79-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
80-
name: crate::avm1::AvmString<'gc>,
79+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
80+
name: $crate::avm1::AvmString<'gc>,
8181
) -> bool {
8282
self.0.read().$field.delete(activation, name)
8383
}
8484

85-
fn proto(&self, activation: &mut crate::avm1::Activation<'_, 'gc, '_>) -> crate::avm1::Value<'gc> {
85+
fn proto(&self, activation: &mut $crate::avm1::Activation<'_, 'gc, '_>) -> $crate::avm1::Value<'gc> {
8686
self.0.read().$field.proto(activation)
8787
}
8888

8989
fn define_value(
9090
&self,
9191
gc_context: gc_arena::MutationContext<'gc, '_>,
92-
name: impl Into<crate::avm1::AvmString<'gc>>,
93-
value: crate::avm1::Value<'gc>,
94-
attributes: crate::avm1::property::Attribute,
92+
name: impl Into<$crate::avm1::AvmString<'gc>>,
93+
value: $crate::avm1::Value<'gc>,
94+
attributes: $crate::avm1::property::Attribute,
9595
) {
9696
self.0
9797
.read()
@@ -102,9 +102,9 @@ macro_rules! impl_custom_object {
102102
fn set_attributes(
103103
&self,
104104
gc_context: gc_arena::MutationContext<'gc, '_>,
105-
name: Option<crate::avm1::AvmString<'gc>>,
106-
set_attributes: crate::avm1::property::Attribute,
107-
clear_attributes: crate::avm1::property::Attribute,
105+
name: Option<$crate::avm1::AvmString<'gc>>,
106+
set_attributes: $crate::avm1::property::Attribute,
107+
clear_attributes: $crate::avm1::property::Attribute,
108108
) {
109109
self.0.write(gc_context).$field.set_attributes(
110110
gc_context,
@@ -117,10 +117,10 @@ macro_rules! impl_custom_object {
117117
fn add_property(
118118
&self,
119119
gc_context: gc_arena::MutationContext<'gc, '_>,
120-
name: crate::avm1::AvmString<'gc>,
121-
get: crate::avm1::object::Object<'gc>,
122-
set: Option<crate::avm1::object::Object<'gc>>,
123-
attributes: crate::avm1::property::Attribute,
120+
name: $crate::avm1::AvmString<'gc>,
121+
get: $crate::avm1::object::Object<'gc>,
122+
set: Option<$crate::avm1::object::Object<'gc>>,
123+
attributes: $crate::avm1::property::Attribute,
124124
) {
125125
self.0
126126
.read()
@@ -130,11 +130,11 @@ macro_rules! impl_custom_object {
130130

131131
fn add_property_with_case(
132132
&self,
133-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
134-
name: crate::avm1::AvmString<'gc>,
135-
get: crate::avm1::object::Object<'gc>,
136-
set: Option<crate::avm1::object::Object<'gc>>,
137-
attributes: crate::avm1::property::Attribute,
133+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
134+
name: $crate::avm1::AvmString<'gc>,
135+
get: $crate::avm1::object::Object<'gc>,
136+
set: Option<$crate::avm1::object::Object<'gc>>,
137+
attributes: $crate::avm1::property::Attribute,
138138
) {
139139
self.0
140140
.read()
@@ -144,32 +144,32 @@ macro_rules! impl_custom_object {
144144

145145
fn has_property(
146146
&self,
147-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
148-
name: crate::avm1::AvmString<'gc>,
147+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
148+
name: $crate::avm1::AvmString<'gc>,
149149
) -> bool {
150150
self.0.read().$field.has_property(activation, name)
151151
}
152152

153153
fn has_own_property(
154154
&self,
155-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
156-
name: crate::avm1::AvmString<'gc>,
155+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
156+
name: $crate::avm1::AvmString<'gc>,
157157
) -> bool {
158158
self.0.read().$field.has_own_property(activation, name)
159159
}
160160

161161
fn has_own_virtual(
162162
&self,
163-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
164-
name: crate::avm1::AvmString<'gc>,
163+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
164+
name: $crate::avm1::AvmString<'gc>,
165165
) -> bool {
166166
self.0.read().$field.has_own_virtual(activation, name)
167167
}
168168

169169
fn is_property_enumerable(
170170
&self,
171-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
172-
name: crate::avm1::AvmString<'gc>,
171+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
172+
name: $crate::avm1::AvmString<'gc>,
173173
) -> bool {
174174
self.0
175175
.read()
@@ -179,23 +179,23 @@ macro_rules! impl_custom_object {
179179

180180
fn get_keys(
181181
&self,
182-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
183-
) -> Vec<crate::avm1::AvmString<'gc>> {
182+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
183+
) -> Vec<$crate::avm1::AvmString<'gc>> {
184184
self.0.read().$field.get_keys(activation)
185185
}
186186

187187
fn type_of(&self) -> &'static str {
188188
self.0.read().$field.type_of()
189189
}
190190

191-
fn interfaces(&self) -> Vec<crate::avm1::Object<'gc>> {
191+
fn interfaces(&self) -> Vec<$crate::avm1::Object<'gc>> {
192192
self.0.read().$field.interfaces()
193193
}
194194

195195
fn set_interfaces(
196196
&self,
197197
gc_context: gc_arena::MutationContext<'gc, '_>,
198-
iface_list: Vec<crate::avm1::Object<'gc>>,
198+
iface_list: Vec<$crate::avm1::Object<'gc>>,
199199
) {
200200
self.0
201201
.write(gc_context)
@@ -207,50 +207,50 @@ macro_rules! impl_custom_object {
207207
Some(self.0.read().$field)
208208
}
209209

210-
fn as_ptr(&self) -> *const crate::avm1::ObjectPtr {
211-
self.0.as_ptr() as *const crate::avm1::ObjectPtr
210+
fn as_ptr(&self) -> *const $crate::avm1::ObjectPtr {
211+
self.0.as_ptr() as *const $crate::avm1::ObjectPtr
212212
}
213213

214-
fn length(&self, activation: &mut crate::avm1::Activation<'_, 'gc, '_>) -> Result<i32, crate::avm1::Error<'gc>> {
214+
fn length(&self, activation: &mut $crate::avm1::Activation<'_, 'gc, '_>) -> Result<i32, $crate::avm1::Error<'gc>> {
215215
self.0.read().$field.length(activation)
216216
}
217217

218-
fn set_length(&self, activation: &mut crate::avm1::Activation<'_, 'gc, '_>, length: i32) -> Result<(), crate::avm1::Error<'gc>> {
218+
fn set_length(&self, activation: &mut $crate::avm1::Activation<'_, 'gc, '_>, length: i32) -> Result<(), $crate::avm1::Error<'gc>> {
219219
self.0.read().$field.set_length(activation, length)
220220
}
221221

222-
fn has_element(&self, activation: &mut crate::avm1::Activation<'_, 'gc, '_>, index: i32) -> bool {
222+
fn has_element(&self, activation: &mut $crate::avm1::Activation<'_, 'gc, '_>, index: i32) -> bool {
223223
self.0.read().$field.has_element(activation, index)
224224
}
225225

226-
fn get_element(&self, activation: &mut crate::avm1::Activation<'_, 'gc, '_>, index: i32) -> crate::avm1::Value<'gc> {
226+
fn get_element(&self, activation: &mut $crate::avm1::Activation<'_, 'gc, '_>, index: i32) -> $crate::avm1::Value<'gc> {
227227
self.0.read().$field.get_element(activation, index)
228228
}
229229

230-
fn set_element(&self, activation: &mut crate::avm1::Activation<'_, 'gc, '_>, index: i32, value: crate::avm1::Value<'gc>) -> Result<(), crate::avm1::Error<'gc>> {
230+
fn set_element(&self, activation: &mut $crate::avm1::Activation<'_, 'gc, '_>, index: i32, value: $crate::avm1::Value<'gc>) -> Result<(), $crate::avm1::Error<'gc>> {
231231
self.0.read().$field.set_element(activation, index, value)
232232
}
233233

234-
fn delete_element(&self, activation: &mut crate::avm1::Activation<'_, 'gc, '_>, index: i32) -> bool {
234+
fn delete_element(&self, activation: &mut $crate::avm1::Activation<'_, 'gc, '_>, index: i32) -> bool {
235235
self.0.read().$field.delete_element(activation, index)
236236
}
237237

238238
fn call_watcher(
239239
&self,
240-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
241-
name: crate::avm1::AvmString<'gc>,
242-
value: &mut crate::avm1::Value<'gc>,
243-
this: crate::avm1::object::Object<'gc>,
244-
) -> Result<(), crate::avm1::Error<'gc>> {
240+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
241+
name: $crate::avm1::AvmString<'gc>,
242+
value: &mut $crate::avm1::Value<'gc>,
243+
this: $crate::avm1::object::Object<'gc>,
244+
) -> Result<(), $crate::avm1::Error<'gc>> {
245245
self.0.read().$field.call_watcher(activation, name, value, this)
246246
}
247247

248248
fn watch(
249249
&self,
250-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
251-
name: crate::avm1::AvmString<'gc>,
252-
callback: crate::avm1::object::Object<'gc>,
253-
user_data: crate::avm1::Value<'gc>,
250+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
251+
name: $crate::avm1::AvmString<'gc>,
252+
callback: $crate::avm1::object::Object<'gc>,
253+
user_data: $crate::avm1::Value<'gc>,
254254
) {
255255
self.0
256256
.read()
@@ -260,8 +260,8 @@ macro_rules! impl_custom_object {
260260

261261
fn unwatch(
262262
&self,
263-
activation: &mut crate::avm1::Activation<'_, 'gc, '_>,
264-
name: crate::avm1::AvmString<'gc>,
263+
activation: &mut $crate::avm1::Activation<'_, 'gc, '_>,
264+
name: $crate::avm1::AvmString<'gc>,
265265
) -> bool {
266266
self.0.read().$field.unwatch(activation, name)
267267
}

core/src/display_object/container.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ macro_rules! impl_display_object_container {
360360

361361
fn child_by_name(
362362
self,
363-
name: &crate::string::WStr,
363+
name: &$crate::string::WStr,
364364
case_sensitive: bool,
365365
) -> Option<DisplayObject<'gc>> {
366366
self.0.read().$field.get_name(name, case_sensitive)
@@ -466,7 +466,7 @@ macro_rules! impl_display_object_container {
466466
child: DisplayObject<'gc>,
467467
index: usize,
468468
) {
469-
use crate::display_object::container::dispatch_added_event;
469+
use $crate::display_object::container::dispatch_added_event;
470470
let parent_changed = if let Some(old_parent) = child.parent() {
471471
if !DisplayObject::ptr_eq(old_parent, (*self).into()) {
472472
if let Some(mut old_parent) = old_parent.as_container() {
@@ -524,7 +524,7 @@ macro_rules! impl_display_object_container {
524524
(*self).into()
525525
));
526526

527-
use crate::display_object::container::dispatch_removed_event;
527+
use $crate::display_object::container::dispatch_removed_event;
528528
dispatch_removed_event(child, context);
529529

530530
let mut write = self.0.write(context.gc_context);
@@ -564,7 +564,7 @@ macro_rules! impl_display_object_container {
564564
.map(|(_, child)| child)
565565
.collect();
566566

567-
use crate::display_object::container::dispatch_removed_event;
567+
use $crate::display_object::container::dispatch_removed_event;
568568
for removed in removed_list.iter() {
569569
dispatch_removed_event(*removed, context);
570570
}
@@ -588,7 +588,7 @@ macro_rules! impl_display_object_container {
588588
}
589589

590590
fn clear(&mut self, context: &mut UpdateContext<'_, 'gc, '_>) {
591-
use crate::display_object::container::dispatch_removed_event;
591+
use $crate::display_object::container::dispatch_removed_event;
592592
let removed_children: Vec<DisplayObject<'gc>> =
593593
self.0.read().$field.iter_render_list().collect();
594594
for removed in removed_children {

swf/src/read.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,6 @@ impl<'a> Reader<'a> {
13111311
while let Some(record) = Self::read_shape_record(&mut bits, &mut shape_context)? {
13121312
start_shape.push(record);
13131313
}
1314-
drop(bits);
13151314

13161315
let mut end_shape = Vec::new();
13171316
self.read_u8()?; // NumFillBits and NumLineBits are written as 0 for the end shape.

0 commit comments

Comments
 (0)