From 5b685d411fec68df6764fd05a16a09f898a3354b Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Sun, 28 Jan 2024 14:45:31 -0500 Subject: [PATCH] chore: Fix nightly Clippy lints --- core/src/display_object/edit_text.rs | 4 +--- core/src/display_object/movie_clip.rs | 4 +--- tests/mocket/src/main.rs | 1 + web/src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/core/src/display_object/edit_text.rs b/core/src/display_object/edit_text.rs index 7f2b8f942..a455e30f7 100644 --- a/core/src/display_object/edit_text.rs +++ b/core/src/display_object/edit_text.rs @@ -1284,9 +1284,7 @@ impl<'gc> EditText<'gc> { pub fn screen_position_to_index(self, position: Point) -> Option { let text = self.0.read(); - let Some(mut position) = self.global_to_local(position) else { - return None; - }; + let mut position = self.global_to_local(position)?; position.x += Twips::from_pixels(Self::INTERNAL_PADDING) + Twips::from_pixels(text.hscroll); position.y += Twips::from_pixels(Self::INTERNAL_PADDING) + text.vertical_scroll_offset(); diff --git a/core/src/display_object/movie_clip.rs b/core/src/display_object/movie_clip.rs index 9d951d541..47aa9b234 100644 --- a/core/src/display_object/movie_clip.rs +++ b/core/src/display_object/movie_clip.rs @@ -3153,9 +3153,7 @@ impl<'gc> TInteractiveObject<'gc> for MovieClip<'gc> { if self.visible() { let this: InteractiveObject<'gc> = (*self).into(); - let Some(local_matrix) = self.global_to_local_matrix() else { - return None; - }; + let local_matrix = self.global_to_local_matrix()?; if let Some(masker) = self.masker() { // FIXME - should this really use `SKIP_INVISIBLE`? Avm2 doesn't. diff --git a/tests/mocket/src/main.rs b/tests/mocket/src/main.rs index d09d53263..7d5beb110 100644 --- a/tests/mocket/src/main.rs +++ b/tests/mocket/src/main.rs @@ -100,6 +100,7 @@ fn main() -> Result<(), Error> { } } } + #[allow(clippy::unused_io_amount)] SocketEvent::WaitForDisconnect => { let mut buffer = [0; 4096]; diff --git a/web/src/lib.rs b/web/src/lib.rs index 818ede48a..5c7c9aad2 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -54,7 +54,7 @@ thread_local! { /// issues with lifetimes and type parameters (which cannot be exported with wasm-bindgen). static INSTANCES: RefCell>> = RefCell::new(Arena::new()); - static CURRENT_CONTEXT: RefCell>> = RefCell::new(None); + static CURRENT_CONTEXT: RefCell>> = const { RefCell::new(None) }; } type AnimationHandler = Closure;