chore: clippy

This commit is contained in:
Adrian Wielgosik 2022-02-03 21:24:09 +01:00 committed by Adrian Wielgosik
parent 2c4b260a8c
commit 562a205f3d
3 changed files with 6 additions and 6 deletions

View File

@ -21,12 +21,12 @@ pub fn instance_init<'gc>(
fn class_call<'gc>(
activation: &mut Activation<'_, 'gc, '_>,
this: Option<Object<'gc>>,
_this: Option<Object<'gc>>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error> {
let this_class = activation.subclass_object().unwrap();
if args.len() == 0 {
if args.is_empty() {
return this_class.construct(activation, args).map(|o| o.into());
}
let arg = args.get(0).cloned().unwrap();

View File

@ -53,15 +53,15 @@ pub fn instance_init<'gc>(
fn class_call<'gc>(
activation: &mut Activation<'_, 'gc, '_>,
this: Option<Object<'gc>>,
_this: Option<Object<'gc>>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error> {
let this_class = activation.subclass_object().unwrap();
if args.len() == 1 {
let arg = args.get(0).cloned().unwrap();
if let Some(_) = arg.as_object().and_then(|o| o.as_regexp_object()) {
return Ok(arg.into());
if arg.as_object().and_then(|o| o.as_regexp_object()).is_some() {
return Ok(arg);
}
}
return this_class.construct(activation, args).map(|o| o.into());

View File

@ -48,7 +48,7 @@ pub fn instance_init<'gc>(
fn class_call<'gc>(
activation: &mut Activation<'_, 'gc, '_>,
this: Option<Object<'gc>>,
_this: Option<Object<'gc>>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error> {
if args.len() != 1 {