diff --git a/core/src/avm1/globals/point.rs b/core/src/avm1/globals/point.rs index d1dbf4bd5..82b0c493b 100644 --- a/core/src/avm1/globals/point.rs +++ b/core/src/avm1/globals/point.rs @@ -148,9 +148,7 @@ fn distance<'gc>( .coerce_to_object(activation); let b = args.get(1).unwrap_or(&Value::Undefined); let delta = a.call_method("subtract", &[b.to_owned()], activation)?; - Ok(delta - .coerce_to_object(activation) - .get("length", activation)?) + delta.coerce_to_object(activation).get("length", activation) } fn polar<'gc>( @@ -176,14 +174,14 @@ fn interpolate<'gc>( args: &[Value<'gc>], ) -> Result, Error<'gc>> { if args.len() < 3 { - return Ok(point_to_object((NAN, NAN), activation)?); + return point_to_object((NAN, NAN), activation); } let a = value_to_point(args.get(0).unwrap().to_owned(), activation)?; let b = value_to_point(args.get(1).unwrap().to_owned(), activation)?; let f = args.get(2).unwrap().coerce_to_f64(activation)?; let result = (b.0 - (b.0 - a.0) * f, b.1 - (b.1 - a.1) * f); - Ok(point_to_object(result, activation)?) + point_to_object(result, activation) } fn to_string<'gc>( diff --git a/core/src/avm1/object/bitmap_data.rs b/core/src/avm1/object/bitmap_data.rs index b57dcbac9..720044e32 100644 --- a/core/src/avm1/object/bitmap_data.rs +++ b/core/src/avm1/object/bitmap_data.rs @@ -269,8 +269,7 @@ impl BitmapData { pub fn flood_fill(&mut self, x: u32, y: u32, replace_color: Color) { let expected_color = self.get_pixel_raw(x, y).unwrap_or_else(|| 0.into()); - let mut pending = Vec::new(); - pending.push((x, y)); + let mut pending = vec![(x, y)]; while !pending.is_empty() { if let Some((x, y)) = pending.pop() { diff --git a/core/src/avm1/test_utils.rs b/core/src/avm1/test_utils.rs index d320e8b37..78d3bde94 100644 --- a/core/src/avm1/test_utils.rs +++ b/core/src/avm1/test_utils.rs @@ -126,11 +126,7 @@ macro_rules! test_method { let function = object.get($name, activation)?; $( - #[allow(unused_mut)] - let mut args: Vec = Vec::new(); - $( - args.push($arg.into()); - )* + let args: Vec = vec![$($arg.into()),*]; assert_eq!(function.call($name, activation, object, None, &args)?, $out.into(), "{:?} => {:?} in swf {}", args, $out, version); )* diff --git a/core/src/avm1/value.rs b/core/src/avm1/value.rs index 518d4db58..d8b5feebd 100644 --- a/core/src/avm1/value.rs +++ b/core/src/avm1/value.rs @@ -272,7 +272,7 @@ impl<'gc> Value<'gc> { } /// ECMA-262 2nd edition s. 11.9.3 Abstract equality comparison algorithm - #[allow(clippy::unknown_clippy_lints, clippy::unnested_or_patterns)] + #[allow(clippy::unnested_or_patterns)] pub fn abstract_eq( &self, other: Value<'gc>, diff --git a/core/src/avm2/globals/object.rs b/core/src/avm2/globals/object.rs index 7728427ea..d7b441ff1 100644 --- a/core/src/avm2/globals/object.rs +++ b/core/src/avm2/globals/object.rs @@ -34,9 +34,8 @@ fn to_string<'gc>( this: Option>, _: &[Value<'gc>], ) -> Result, Error> { - Ok(this - .map(|t| t.to_string(activation.context.gc_context)) - .unwrap_or(Ok(Value::Undefined))?) + this.map(|t| t.to_string(activation.context.gc_context)) + .unwrap_or(Ok(Value::Undefined)) } /// Implements `Object.prototype.toLocaleString` @@ -45,9 +44,8 @@ fn to_locale_string<'gc>( this: Option>, _: &[Value<'gc>], ) -> Result, Error> { - Ok(this - .map(|t| t.to_locale_string(activation.context.gc_context)) - .unwrap_or(Ok(Value::Undefined))?) + this.map(|t| t.to_locale_string(activation.context.gc_context)) + .unwrap_or(Ok(Value::Undefined)) } /// Implements `Object.prototype.valueOf` @@ -56,9 +54,8 @@ fn value_of<'gc>( this: Option>, _: &[Value<'gc>], ) -> Result, Error> { - Ok(this - .map(|t| t.value_of(activation.context.gc_context)) - .unwrap_or(Ok(Value::Undefined))?) + this.map(|t| t.value_of(activation.context.gc_context)) + .unwrap_or(Ok(Value::Undefined)) } /// `Object.prototype.hasOwnProperty` diff --git a/core/src/avm2/object.rs b/core/src/avm2/object.rs index 452050754..5ba4bd503 100644 --- a/core/src/avm2/object.rs +++ b/core/src/avm2/object.rs @@ -263,7 +263,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into> + Clone + Copy } if let Some(proto) = self.proto() { - return Ok(proto.resolve_multiname(multiname)?); + return proto.resolve_multiname(multiname); } Ok(None) diff --git a/core/src/avm2/value.rs b/core/src/avm2/value.rs index de3bb6d5a..c12a0fdab 100644 --- a/core/src/avm2/value.rs +++ b/core/src/avm2/value.rs @@ -583,11 +583,7 @@ impl<'gc> Value<'gc> { _ => unreachable!(), }; - Ok(PrimitiveObject::from_primitive( - self.clone(), - proto, - activation.context.gc_context, - )?) + PrimitiveObject::from_primitive(self.clone(), proto, activation.context.gc_context) } /// Determine if two values are abstractly equal to each other. diff --git a/core/src/events.rs b/core/src/events.rs index 88303e22d..59075ed95 100644 --- a/core/src/events.rs +++ b/core/src/events.rs @@ -1,6 +1,5 @@ use num_enum::{IntoPrimitive, TryFromPrimitive}; -#[allow(clippy::enum_variant_names)] #[derive(Debug)] pub enum PlayerEvent { KeyDown { key_code: KeyCode }, diff --git a/core/src/lib.rs b/core/src/lib.rs index 92099c9c7..d356b2f29 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,8 +1,8 @@ #![allow( - clippy::manual_range_contains, - clippy::unneeded_field_pattern, - clippy::same_item_push, + renamed_and_removed_lints, clippy::unknown_clippy_lints, + clippy::manual_range_contains, + clippy::same_item_push, clippy::unnecessary_wraps )] diff --git a/desktop/src/main.rs b/desktop/src/main.rs index 8ec961007..1b68a7491 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -1,5 +1,3 @@ -#![allow(clippy::unneeded_field_pattern)] - mod audio; mod custom_event; mod executor; diff --git a/swf/src/avm2/opcode.rs b/swf/src/avm2/opcode.rs index 8a255cfa3..2b9a216b8 100644 --- a/swf/src/avm2/opcode.rs +++ b/swf/src/avm2/opcode.rs @@ -1,5 +1,3 @@ -#![allow(clippy::useless_attribute)] - #[derive(Debug, PartialEq, Clone, Copy, FromPrimitive)] pub enum OpCode { Add = 0xA0, diff --git a/swf/src/lib.rs b/swf/src/lib.rs index ccb7acb96..57df39efb 100644 --- a/swf/src/lib.rs +++ b/swf/src/lib.rs @@ -6,7 +6,7 @@ //! //! This library consists of a `read` module for decoding SWF data, and a `write` library for //! writing SWF data. -#![allow(clippy::unusual_byte_groupings, clippy::unknown_clippy_lints)] +#![allow(clippy::unusual_byte_groupings)] extern crate byteorder; #[cfg(feature = "flate2")] diff --git a/swf/src/read.rs b/swf/src/read.rs index 36f9f6545..15ddd348f 100644 --- a/swf/src/read.rs +++ b/swf/src/read.rs @@ -1,7 +1,8 @@ #![allow( + renamed_and_removed_lints, + clippy::unknown_clippy_lints, clippy::float_cmp, clippy::inconsistent_digit_grouping, - clippy::unknown_clippy_lints, clippy::unreadable_literal )] diff --git a/swf/src/types/matrix.rs b/swf/src/types/matrix.rs index eb845021e..535737264 100644 --- a/swf/src/types/matrix.rs +++ b/swf/src/types/matrix.rs @@ -1,4 +1,8 @@ -#![allow(clippy::suspicious_operation_groupings)] +#![allow( + renamed_and_removed_lints, + clippy::unknown_clippy_lints, + clippy::suspicious_operation_groupings +)] use crate::Twips; diff --git a/web/src/lib.rs b/web/src/lib.rs index 08dd5bd84..4155036ed 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -1,4 +1,8 @@ -#![allow(clippy::same_item_push, clippy::unknown_clippy_lints)] +#![allow( + renamed_and_removed_lints, + clippy::same_item_push, + clippy::unknown_clippy_lints +)] //! Ruffle web frontend. mod audio;