chore: Fix nightly Clippy lints

This commit is contained in:
Aaron Hill 2024-01-28 14:45:31 -05:00
parent 40c0f90105
commit 5b685d411f
4 changed files with 4 additions and 7 deletions

View File

@ -1284,9 +1284,7 @@ impl<'gc> EditText<'gc> {
pub fn screen_position_to_index(self, position: Point<Twips>) -> Option<usize> { pub fn screen_position_to_index(self, position: Point<Twips>) -> Option<usize> {
let text = self.0.read(); let text = self.0.read();
let Some(mut position) = self.global_to_local(position) else { let mut position = self.global_to_local(position)?;
return None;
};
position.x += Twips::from_pixels(Self::INTERNAL_PADDING) + Twips::from_pixels(text.hscroll); 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(); position.y += Twips::from_pixels(Self::INTERNAL_PADDING) + text.vertical_scroll_offset();

View File

@ -3153,9 +3153,7 @@ impl<'gc> TInteractiveObject<'gc> for MovieClip<'gc> {
if self.visible() { if self.visible() {
let this: InteractiveObject<'gc> = (*self).into(); let this: InteractiveObject<'gc> = (*self).into();
let Some(local_matrix) = self.global_to_local_matrix() else { let local_matrix = self.global_to_local_matrix()?;
return None;
};
if let Some(masker) = self.masker() { if let Some(masker) = self.masker() {
// FIXME - should this really use `SKIP_INVISIBLE`? Avm2 doesn't. // FIXME - should this really use `SKIP_INVISIBLE`? Avm2 doesn't.

View File

@ -100,6 +100,7 @@ fn main() -> Result<(), Error> {
} }
} }
} }
#[allow(clippy::unused_io_amount)]
SocketEvent::WaitForDisconnect => { SocketEvent::WaitForDisconnect => {
let mut buffer = [0; 4096]; let mut buffer = [0; 4096];

View File

@ -54,7 +54,7 @@ thread_local! {
/// issues with lifetimes and type parameters (which cannot be exported with wasm-bindgen). /// issues with lifetimes and type parameters (which cannot be exported with wasm-bindgen).
static INSTANCES: RefCell<Arena<RefCell<RuffleInstance>>> = RefCell::new(Arena::new()); static INSTANCES: RefCell<Arena<RefCell<RuffleInstance>>> = RefCell::new(Arena::new());
static CURRENT_CONTEXT: RefCell<Option<*mut UpdateContext<'static, 'static>>> = RefCell::new(None); static CURRENT_CONTEXT: RefCell<Option<*mut UpdateContext<'static, 'static>>> = const { RefCell::new(None) };
} }
type AnimationHandler = Closure<dyn FnMut(f64)>; type AnimationHandler = Closure<dyn FnMut(f64)>;