Skip to content

Commit c2e78ff

Browse files
relrelbHerschel
authored andcommitted
chore: Appease clippy
Resolve 2 instances of `only_used_in_recursion`.
1 parent 0d6462c commit c2e78ff

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

core/src/avm2/globals/flash/external/externalinterface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn call<'gc>(
4343
{
4444
let mut external_args = Vec::with_capacity(args.len() - 1);
4545
for arg in &args[1..] {
46-
external_args.push(ExternalValue::from_avm2(activation, arg.to_owned())?);
46+
external_args.push(ExternalValue::from_avm2(arg.to_owned())?);
4747
}
4848
Ok(method
4949
.call(&mut activation.context, &external_args)

core/src/avm2/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
818818
if my_class.is_none() && Object::ptr_eq(test_class, activation.avm2().classes().object) {
819819
Ok(true)
820820
} else if let Some(my_class) = my_class {
821-
my_class.has_class_in_chain(test_class, activation)
821+
my_class.has_class_in_chain(test_class)
822822
} else {
823823
Ok(false)
824824
}

core/src/avm2/object/class_object.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,7 @@ impl<'gc> ClassObject<'gc> {
426426
/// interface we are checking against this class.
427427
///
428428
/// To test if a class *instance* is of a given type, see is_of_type.
429-
pub fn has_class_in_chain(
430-
self,
431-
test_class: ClassObject<'gc>,
432-
activation: &mut Activation<'_, 'gc, '_>,
433-
) -> Result<bool, Error> {
429+
pub fn has_class_in_chain(self, test_class: ClassObject<'gc>) -> Result<bool, Error> {
434430
let mut my_class = Some(self);
435431

436432
while let Some(class) = my_class {
@@ -451,7 +447,7 @@ impl<'gc> ClassObject<'gc> {
451447

452448
are_all_params_coercible &= match (my_param, test_param) {
453449
(Some(my_param), Some(test_param)) => {
454-
my_param.has_class_in_chain(test_param, activation)?
450+
my_param.has_class_in_chain(test_param)?
455451
}
456452
(None, Some(_)) => false,
457453
_ => true,

core/src/external.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,7 @@ impl Value {
183183
}
184184
}
185185

186-
pub fn from_avm2<'gc>(
187-
activation: &mut Avm2Activation<'_, 'gc, '_>,
188-
value: Avm2Value<'gc>,
189-
) -> Result<Value, Avm2Error> {
186+
pub fn from_avm2(value: Avm2Value) -> Result<Value, Avm2Error> {
190187
Ok(match value {
191188
Avm2Value::Undefined | Avm2Value::Null => Value::Null,
192189
Avm2Value::Bool(value) => value.into(),
@@ -201,7 +198,7 @@ impl Value {
201198
.map(|i| {
202199
// FIXME - is this right?
203200
let element = array.get(i).unwrap_or(Avm2Value::Null);
204-
Value::from_avm2(activation, element)
201+
Value::from_avm2(element)
205202
})
206203
.collect();
207204
Value::List(values?)
@@ -289,7 +286,7 @@ impl<'gc> Callback<'gc> {
289286
.collect();
290287
if let Ok(result) = method
291288
.call(None, &args, &mut activation)
292-
.and_then(|value| Value::from_avm2(&mut activation, value))
289+
.and_then(Value::from_avm2)
293290
{
294291
result
295292
} else {

0 commit comments

Comments
 (0)