Skip to content

Commit

Permalink
chore: Fix clippy errors on beta
Browse files Browse the repository at this point in the history
  • Loading branch information
kjarosh committed Sep 5, 2024
1 parent f538f67 commit 8dac02b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion core/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use syn::{
TraitItem, Visibility,
};

/// `enum_trait_object` will define an enum whose variants each implement a trait.
/// Define an enum whose variants each implement a trait.
///
/// It can be used as faux-dynamic dispatch. This is used as an alternative to a
/// trait object, which doesn't get along with GC'd types.
///
Expand Down
7 changes: 7 additions & 0 deletions core/src/backend/audio/decoders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ impl<T: Decoder + ?Sized> Decoder for Box<T> {
}
}

/// Audio stream decoder.
///
/// A "stream" sound is a sound that has its data distributed across `SoundStreamBlock` tags,
/// one per each frame of a MovieClip. The sound is synced to the MovieClip's timeline, and will
/// stop/seek as the MovieClip stops/seeks.
Expand Down Expand Up @@ -144,6 +146,8 @@ impl Iterator for StandardStreamDecoder {
}
}

/// ADPCM stream decoder.
///
/// Stream sounds encoded with ADPCM have an ADPCM header in each `SoundStreamBlock` tag, unlike
/// other compression formats that remain the same as if they were a single sound clip.
/// Therefore, we must recreate the decoder with each `SoundStreamBlock` to parse the additional
Expand Down Expand Up @@ -482,6 +486,7 @@ impl Read for SubstreamTagReader {
}

/// Create a new decoder that reads data from a shared `Substream` instance.
///
/// This works similarly to `make_stream_decoder` but using the new buffer
/// infrastructure that will eventually replace SWF-specific streaming.
///
Expand Down Expand Up @@ -537,6 +542,8 @@ impl Iterator for StandardSubstreamDecoder {
}
}

/// ADPCM substream decoder.
///
/// Stream sounds encoded with ADPCM have an ADPCM header in each `SoundStreamBlock` tag, unlike
/// other compression formats that remain the same as if they were a single sound clip.
/// Therefore, we must recreate the decoder with each `SoundStreamBlock` to parse the additional
Expand Down
10 changes: 6 additions & 4 deletions core/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,13 @@ impl From<MouseButton> for KeyCode {
}
}

/// Key codes for SWF4 keyPress button handlers. These are annoyingly different than
/// `Key.isDown` key codes.
/// Key codes for SWF4 keyPress button handlers.
///
/// These are annoyingly different than `Key.isDown` key codes.
///
/// TODO: After 18, these are mostly ASCII... should we just use u8? How are different
/// keyboard layouts/languages handled?
/// SWF19 pp. 198-199
/// keyboard layouts/languages handled?
/// SWF19 pp. 198-199
#[derive(Debug, PartialEq, Eq, Copy, Clone, FromPrimitive, ToPrimitive)]
pub enum ButtonKeyCode {
Unknown = 0,
Expand Down
1 change: 1 addition & 0 deletions core/src/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use gc_arena::Collect;
use std::collections::BTreeMap;

/// An intermediate format of representing shared data between ActionScript and elsewhere.
///
/// Regardless of the capabilities of both sides, all data will be translated to this potentially
/// lossy format. Any recursion or additional metadata in ActionScript will not be translated.
#[derive(Debug, Clone, PartialEq)]
Expand Down
1 change: 1 addition & 0 deletions render/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub trait CommandHandler {
}

/// Holds either a normal BlendMode, or the shader for BlendMode.SHADER.
///
/// We cannot store the `PixelBenderShaderHandle` directly in `ExtendedBlendMode`,
/// since we need to remember the shader even if the blend mode is changed
/// to something else (so that the shader will still be used if we switch back)
Expand Down
9 changes: 5 additions & 4 deletions render/src/pixel_bender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,11 @@ pub enum PixelBenderShaderArgument<'a> {
},
}

/// An image input. This accepts both an owned BitmapHandle,
/// and a borrowed texture (used when applying a filter to
/// a texture that we don't have ownership of, and therefore
/// cannot construct a BitmapHandle for).
/// An image input.
///
/// This accepts both an owned BitmapHandle, and a borrowed texture
/// (used when applying a filter to a texture that we don't have
/// ownership of, and therefore cannot construct a BitmapHandle for).
#[derive(Debug, Clone)]
pub enum ImageInputTexture<'a> {
Bitmap(BitmapHandle),
Expand Down
3 changes: 2 additions & 1 deletion swf/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,8 @@ pub type DoAction<'a> = &'a [u8];

pub type JpegTables<'a> = &'a [u8];

/// `ProductInfo` contains information about the software used to generate the SWF.
/// Contains information about the software used to generate the SWF.
///
/// Not documented in the SWF19 reference. Emitted by mxmlc.
/// See <http://wahlers.com.br/claus/blog/undocumented-swf-tags-written-by-mxmlc/>
#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down

0 comments on commit 8dac02b

Please sign in to comment.