Skip to content

Commit

Permalink
chore: Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
relrelb committed Jun 26, 2021
1 parent 9c1ebc7 commit 169c79f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions core/src/avm1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions core/src/backend/audio/decoders/pcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/src/display_object/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 2 additions & 4 deletions swf/src/avm1/read.rs
Original file line number Diff line number Diff line change
@@ -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,
}

Expand Down Expand Up @@ -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
};
Expand Down

0 comments on commit 169c79f

Please sign in to comment.