chore: Minor cleanups

This commit is contained in:
relrelb 2021-06-26 17:23:09 +03:00 committed by relrelb
parent 9c1ebc7f20
commit 169c79fa3a
4 changed files with 5 additions and 5 deletions

View File

@ -623,6 +623,7 @@ pub struct DisplayObjectIter<'gc> {
impl<'gc> Iterator for DisplayObjectIter<'gc> {
type Item = DisplayObject<'gc>;
fn next(&mut self) -> Option<Self::Item> {
let clip = self.clip;
self.clip = clip.and_then(|clip| clip.next_avm1_clip());

View File

@ -24,6 +24,7 @@ impl<R: Read> PcmDecoder<R> {
impl<R: Read> Iterator for PcmDecoder<R> {
type Item = [i16; 2];
#[allow(unknown_lints, clippy::branches_sharing_code)]
fn next(&mut self) -> Option<Self::Item> {
if self.is_stereo {

View File

@ -921,7 +921,7 @@ impl<'gc> RenderIter<'gc> {
impl<'gc> Iterator for RenderIter<'gc> {
type Item = DisplayObject<'gc>;
fn next(&mut self) -> Option<DisplayObject<'gc>> {
fn next(&mut self) -> Option<Self::Item> {
if self.i == self.neg_i {
return None;
}

View File

@ -1,12 +1,10 @@
#![allow(clippy::unreadable_literal)]
use crate::avm1::{opcode::OpCode, types::*};
use crate::error::{Error, Result};
use crate::extensions::ReadSwfExt;
#[allow(dead_code)]
pub struct Reader<'a> {
input: &'a [u8],
#[allow(dead_code)]
version: u8,
}
@ -68,7 +66,7 @@ impl<'a> Reader<'a> {
pub fn read_opcode_and_length(&mut self) -> Result<(u8, usize)> {
let opcode = self.read_u8()?;
let length = if opcode >= 0x80 {
self.read_u16()? as usize
self.read_u16()?.into()
} else {
0
};