Skip to content

Commit

Permalink
build: Fix redundant import warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian17 committed Mar 23, 2024
1 parent a7d5a5c commit 08157a0
Show file tree
Hide file tree
Showing 30 changed files with 28 additions and 51 deletions.
6 changes: 2 additions & 4 deletions core/src/avm1/globals/movie_clip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use crate::avm1::property_decl::{define_properties_on, Declaration};
use crate::avm1::{self, ArrayObject, Object, ScriptObject, TObject, Value};
use crate::backend::navigator::NavigationMethod;
use crate::context::{GcContext, UpdateContext};
use crate::display_object::{
Bitmap, DisplayObject, EditText, MovieClip, TDisplayObject, TDisplayObjectContainer,
};
use crate::display_object::{Bitmap, EditText, MovieClip};
use crate::ecma_conversions::f64_to_wrapping_i32;
use crate::prelude::*;
use crate::string::AvmString;
Expand All @@ -20,7 +18,7 @@ use crate::{avm1_stub, avm_error, avm_warn};
use ruffle_render::shape_utils::{DrawCommand, GradientType};
use swf::{
FillStyle, Fixed8, Gradient, GradientInterpolation, GradientRecord, GradientSpread,
LineCapStyle, LineJoinStyle, LineStyle, Rectangle, Twips,
LineCapStyle, LineJoinStyle, LineStyle,
};

macro_rules! mc_method {
Expand Down
1 change: 0 additions & 1 deletion core/src/avm1/object/script_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,6 @@ mod tests {

use crate::avm1::function::Executable;
use crate::avm1::function::FunctionObject;
use crate::avm1::property::Attribute;

fn with_object<F>(swf_version: u8, test: F)
where
Expand Down
2 changes: 1 addition & 1 deletion core/src/avm2/bytearray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::cell::Cell;
use std::cmp;
use std::fmt::{self, Display, Formatter};
use std::io::prelude::*;
use std::io::{self, Read, SeekFrom};
use std::io::{self, SeekFrom};

#[derive(Clone, Collect, Debug, Copy, PartialEq, Eq)]
#[collect(no_drop)]
Expand Down
2 changes: 1 addition & 1 deletion core/src/avm2/dynamic_map.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use fnv::FnvBuildHasher;
use gc_arena::Collect;
use hashbrown::{self, raw::RawTable};
use hashbrown::raw::RawTable;
use std::{cell::Cell, hash::Hash};

use super::{string::AvmString, Object};
Expand Down
3 changes: 0 additions & 3 deletions core/src/avm2/globals/flash/display/display_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::avm2::value::Value;
use crate::avm2::StageObject;
use crate::avm2::{ArrayObject, ArrayStorage};
use crate::avm2::{ClassObject, Error};
use crate::display_object::{DisplayObject, HitTestOptions, TDisplayObject};
use crate::ecma_conversions::round_to_even;
use crate::prelude::*;
use crate::string::AvmString;
Expand All @@ -19,8 +18,6 @@ use crate::{avm2_stub_getter, avm2_stub_setter};
use ruffle_render::blend::ExtendedBlendMode;
use ruffle_render::filters::Filter;
use std::str::FromStr;
use swf::Rectangle;
use swf::Twips;

pub fn display_object_allocator<'gc>(
class: ClassObject<'gc>,
Expand Down
1 change: 0 additions & 1 deletion core/src/avm2/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use crate::tag_utils::SwfMovie;
use crate::PlayerRuntime;
use gc_arena::{Collect, Gc, GcCell, Mutation};
use std::cell::Ref;
use std::mem::drop;
use std::rc::Rc;
use std::sync::Arc;
use swf::avm2::types::{
Expand Down
1 change: 0 additions & 1 deletion core/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use gc_arena::Collect;
use std::cmp::min;
use std::fmt::{Debug, Formatter, LowerHex, UpperHex};
use std::io::{Error as IoError, ErrorKind as IoErrorKind, Read, Result as IoResult};
use std::iter::Iterator;
use std::ops::{Bound, Deref, RangeBounds};
use std::sync::{Arc, RwLock, RwLockReadGuard};
use thiserror::Error;
Expand Down
2 changes: 1 addition & 1 deletion core/src/display_object/avm1_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::display_object::container::{
use crate::display_object::interactive::{
InteractiveObject, InteractiveObjectBase, TInteractiveObject,
};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, TDisplayObject};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr};
use crate::events::{ClipEvent, ClipEventResult};
use crate::prelude::*;
use crate::tag_utils::{SwfMovie, SwfSlice};
Expand Down
2 changes: 1 addition & 1 deletion core/src/display_object/avm2_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::display_object::container::{dispatch_added_event, dispatch_removed_ev
use crate::display_object::interactive::{
InteractiveObject, InteractiveObjectBase, TInteractiveObject,
};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, MovieClip, TDisplayObject};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, MovieClip};
use crate::events::{ClipEvent, ClipEventResult};
use crate::frame_lifecycle::catchup_display_object_to_frame;
use crate::prelude::*;
Expand Down
4 changes: 1 addition & 3 deletions core/src/display_object/bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ use crate::avm2::{
};
use crate::bitmap::bitmap_data::{BitmapData, BitmapDataWrapper};
use crate::context::{RenderContext, UpdateContext};
use crate::display_object::{
DisplayObjectBase, DisplayObjectPtr, DisplayObjectWeak, TDisplayObject,
};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, DisplayObjectWeak};
use crate::prelude::*;
use crate::tag_utils::SwfMovie;
use crate::vminterface::Instantiator;
Expand Down
4 changes: 2 additions & 2 deletions core/src/display_object/edit_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::context::{RenderContext, UpdateContext};
use crate::display_object::interactive::{
InteractiveObject, InteractiveObjectBase, TInteractiveObject,
};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, TDisplayObject};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr};
use crate::drawing::Drawing;
use crate::events::{ClipEvent, ClipEventResult, TextControlCode};
use crate::font::{round_down_to_pixel, FontType, Glyph, TextRenderSettings};
Expand All @@ -39,7 +39,7 @@ use ruffle_wstr::WStrToUtf8;
use std::cmp::Ordering;
use std::collections::VecDeque;
use std::{cell::Ref, cell::RefMut, sync::Arc};
use swf::{Color, ColorTransform, Twips};
use swf::ColorTransform;
use unic_segment::WordBoundIndices;

use super::interactive::Avm2MousePick;
Expand Down
2 changes: 1 addition & 1 deletion core/src/display_object/graphic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::avm2::{
Activation as Avm2Activation, Object as Avm2Object, StageObject as Avm2StageObject,
};
use crate::context::{RenderContext, UpdateContext};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, TDisplayObject};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr};
use crate::drawing::Drawing;
use crate::library::MovieLibrarySource;
use crate::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion core/src/display_object/loader_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::context::RenderContext;
use crate::context::UpdateContext;
use crate::display_object::InteractiveObject;
use crate::display_object::TInteractiveObject;
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, TDisplayObject};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr};
use crate::events::{ClipEvent, ClipEventResult};
use crate::prelude::*;

Expand Down
4 changes: 2 additions & 2 deletions core/src/display_object/morph_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::avm2::{
Activation as Avm2Activation, Object as Avm2Object, StageObject as Avm2StageObject,
};
use crate::context::{RenderContext, UpdateContext};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, TDisplayObject};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr};
use crate::library::{Library, MovieLibrarySource};
use crate::prelude::*;
use crate::tag_utils::SwfMovie;
Expand All @@ -12,7 +12,7 @@ use ruffle_render::backend::ShapeHandle;
use ruffle_render::commands::CommandHandler;
use std::cell::{Ref, RefCell, RefMut};
use std::sync::Arc;
use swf::{Fixed16, Fixed8, Twips};
use swf::{Fixed16, Fixed8};

#[derive(Clone, Collect, Copy)]
#[collect(no_drop)]
Expand Down
6 changes: 2 additions & 4 deletions core/src/display_object/movie_clip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ use crate::binary_data::BinaryData;
use crate::character::{Character, CompressedBitmap};
use crate::context::{ActionType, RenderContext, UpdateContext};
use crate::context_stub;
use crate::display_object::container::{
dispatch_removed_event, ChildContainer, TDisplayObjectContainer,
};
use crate::display_object::container::{dispatch_removed_event, ChildContainer};
use crate::display_object::interactive::{
InteractiveObject, InteractiveObjectBase, TInteractiveObject,
};
use crate::display_object::{
Avm1Button, Avm2Button, DisplayObjectBase, DisplayObjectPtr, EditText, Graphic, MorphShape,
TDisplayObject, Text, Video,
Text, Video,
};
use crate::drawing::Drawing;
use crate::events::{ButtonKeyCode, ClipEvent, ClipEventResult};
Expand Down
8 changes: 2 additions & 6 deletions core/src/display_object/stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ use crate::avm2::{
use crate::backend::ui::MouseCursor;
use crate::config::Letterbox;
use crate::context::{RenderContext, UpdateContext};
use crate::display_object::container::{
ChildContainer, DisplayObjectContainer, TDisplayObjectContainer,
};
use crate::display_object::container::ChildContainer;
use crate::display_object::interactive::{
InteractiveObject, InteractiveObjectBase, TInteractiveObject,
};
use crate::display_object::{
render_base, DisplayObject, DisplayObjectBase, DisplayObjectPtr, TDisplayObject,
};
use crate::display_object::{render_base, DisplayObjectBase, DisplayObjectPtr};
use crate::events::{ClipEvent, ClipEventResult};
use crate::prelude::*;
use crate::string::{FromWStr, WStr};
Expand Down
2 changes: 1 addition & 1 deletion core/src/display_object/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::avm2::{
Activation as Avm2Activation, Object as Avm2Object, StageObject as Avm2StageObject,
};
use crate::context::{RenderContext, UpdateContext};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, TDisplayObject};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr};
use crate::font::TextRenderSettings;
use crate::prelude::*;
use crate::tag_utils::SwfMovie;
Expand Down
4 changes: 2 additions & 2 deletions core/src/display_object/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::avm2::{
Value as Avm2Value,
};
use crate::context::{RenderContext, UpdateContext};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr, TDisplayObject};
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr};
use crate::prelude::*;
use crate::streams::NetStream;
use crate::tag_utils::{SwfMovie, SwfSlice};
Expand All @@ -23,7 +23,7 @@ use std::borrow::BorrowMut;
use std::cell::{Ref, RefMut};
use std::collections::{BTreeMap, BTreeSet};
use std::sync::Arc;
use swf::{CharacterId, DefineVideoStream, VideoCodec, VideoFrame};
use swf::{DefineVideoStream, VideoCodec, VideoFrame};

/// A Video display object is a high-level interface to a video player.
///
Expand Down
2 changes: 1 addition & 1 deletion core/src/html/dimensions.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! CSS dimension types
use std::cmp::{max, min, Ord};
use std::cmp::{max, min};
use std::ops::{Add, AddAssign, Sub};
use swf::{Rectangle, Twips};

Expand Down
3 changes: 1 addition & 2 deletions core/src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::backend::audio::SoundHandle;
use crate::character::Character;
use std::borrow::Cow;

use crate::display_object::{Bitmap, Graphic, MorphShape, TDisplayObject, Text};
use crate::display_object::{Bitmap, Graphic, MorphShape, Text};
use crate::font::{Font, FontDescriptor, FontType};
use crate::prelude::*;
use crate::string::AvmString;
Expand All @@ -19,7 +19,6 @@ use crate::DefaultFont;
use fnv::{FnvHashMap, FnvHashSet};
use std::collections::HashMap;
use std::sync::{Arc, Weak};
use swf::CharacterId;
use weak_table::{traits::WeakElement, PtrWeakKeyHashMap, WeakValueHashMap};

#[derive(Clone)]
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/backends/navigator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use futures::{AsyncReadExt, AsyncWriteExt};
use futures_lite::FutureExt;
use isahc::http::{HeaderName, HeaderValue};
use isahc::{
config::RedirectPolicy, prelude::*, AsyncBody, AsyncReadResponseExt, HttpClient,
Request as IsahcRequest, Response as IsahcResponse,
config::RedirectPolicy, prelude::*, AsyncBody, HttpClient, Request as IsahcRequest,
Response as IsahcResponse,
};
use rfd::{AsyncMessageDialog, MessageButtons, MessageDialog, MessageDialogResult, MessageLevel};
use ruffle_core::backend::navigator::{
Expand Down
1 change: 0 additions & 1 deletion desktop/src/preferences/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ impl<'a> PreferencesWriter<'a> {
#[cfg(test)]
mod tests {
use super::*;
use crate::log::FilenamePattern;
use crate::preferences::read::read_preferences;
use fluent_templates::loader::langid;

Expand Down
2 changes: 1 addition & 1 deletion render/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::cell::RefCell;
use std::fmt::Debug;
use std::rc::Rc;
use std::sync::Arc;
use swf::{self, Color, Rectangle, Twips};
use swf::{Color, Rectangle, Twips};

pub struct BitmapCacheEntry {
pub handle: BitmapHandle,
Expand Down
2 changes: 0 additions & 2 deletions render/src/shape_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1436,8 +1436,6 @@ mod tests {
assert_eq!(commands, expected);
}

use swf::Twips;

#[test]
fn test_winding_number_line() {
fn test(
Expand Down
2 changes: 0 additions & 2 deletions swf/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2556,9 +2556,7 @@ pub fn read_compression_type<R: Read>(mut input: R) -> Result<Compression> {
#[allow(clippy::unusual_byte_groupings)]
pub mod tests {
use super::*;
use crate::tag_code::TagCode;
use crate::test_data;
use std::vec::Vec;

fn reader(data: &[u8]) -> Reader<'_> {
let default_version = 13;
Expand Down
1 change: 0 additions & 1 deletion swf/src/test_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::types::*;
use crate::write::write_swf;
use std::borrow::Cow;
use std::fs::File;
use std::vec::Vec;

#[allow(dead_code)]
pub fn echo_swf(filename: &str) {
Expand Down
1 change: 0 additions & 1 deletion swf/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2434,7 +2434,6 @@ fn count_fbits(n: Fixed16) -> u32 {
#[cfg(test)]
#[allow(clippy::unusual_byte_groupings)]
mod tests {
use super::Writer;
use super::*;
use crate::test_data;

Expand Down
2 changes: 1 addition & 1 deletion web/src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::time::Duration;
use tracing_subscriber::layer::Layered;
use tracing_subscriber::Registry;
use tracing_wasm::WASMLayer;
use wasm_bindgen::{closure::Closure, prelude::*, JsCast};
use wasm_bindgen::prelude::*;
use web_sys::AudioContext;

#[allow(dead_code)]
Expand Down
2 changes: 1 addition & 1 deletion web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use tracing_subscriber::layer::{Layered, SubscriberExt};
use tracing_subscriber::registry::Registry;
use tracing_wasm::{WASMLayer, WASMLayerConfigBuilder};
use url::Url;
use wasm_bindgen::{prelude::*, JsCast, JsValue};
use wasm_bindgen::prelude::*;
use web_sys::{
AddEventListenerOptions, ClipboardEvent, Element, Event, EventTarget, HtmlCanvasElement,
HtmlElement, KeyboardEvent, PointerEvent, WheelEvent, Window,
Expand Down
1 change: 1 addition & 0 deletions web/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use web_sys::{HtmlCanvasElement, HtmlDocument, HtmlTextAreaElement};

use chrono::{DateTime, Utc};

#[allow(dead_code)]
#[derive(Debug)]
struct FullScreenError {
jsval: String,
Expand Down

0 comments on commit 08157a0

Please sign in to comment.