Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant imports #12817

Merged
merged 6 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/bevy_color/src/hsla.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ mod tests {
use super::*;
use crate::{
color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq,
Srgba,
};

#[test]
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_color/src/hsva.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ mod tests {
use super::*;
use crate::{
color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq,
Srgba,
};

#[test]
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_color/src/hwba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ mod tests {
use super::*;
use crate::{
color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq,
Srgba,
};

#[test]
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_color/src/laba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ mod tests {
use super::*;
use crate::{
color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq,
Srgba,
};

#[test]
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_color/src/lcha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ mod tests {
use super::*;
use crate::{
color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq,
Srgba,
};

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_color/src/oklaba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl From<Oklaba> for Xyza {
#[cfg(test)]
mod tests {
use super::*;
use crate::{test_colors::TEST_COLORS, testing::assert_approx_eq, Srgba};
use crate::{test_colors::TEST_COLORS, testing::assert_approx_eq};

#[test]
fn test_to_from_srgba() {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_color/src/oklcha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ impl From<Oklcha> for Xyza {
#[cfg(test)]
mod tests {
use super::*;
use crate::{test_colors::TEST_COLORS, testing::assert_approx_eq, Srgba};
use crate::{test_colors::TEST_COLORS, testing::assert_approx_eq};

#[test]
fn test_to_from_srgba() {
Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_ecs/src/entity/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ pub type EntityHashSet = hashbrown::HashSet<Entity, EntityHash>;
#[cfg(test)]
mod tests {
use super::*;
#[cfg(feature = "bevy_reflect")]
use bevy_reflect::Reflect;
use static_assertions::assert_impl_all;

// Check that the HashMaps are Clone if the key/values are Clone
Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_ecs/src/query/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ mod tests {
use crate::prelude::*;
use crate::world::FilteredEntityRef;

use super::QueryBuilder;

#[derive(Component, PartialEq, Debug)]
struct A(usize);

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/schedule/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ mod tests {
use crate as bevy_ecs;
use crate::component::Component;
use crate::schedule::IntoSystemConfigs;
use crate::schedule::{common_conditions::not, State, States};
use crate::schedule::{State, States};
use crate::system::Local;
use crate::{change_detection::ResMut, schedule::Schedule, world::World};
use bevy_ecs_macros::Event;
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_ecs/src/schedule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mod tests {
use std::sync::atomic::{AtomicU32, Ordering};

pub use crate as bevy_ecs;
pub use crate::schedule::{IntoSystemSetConfigs, Schedule, SystemSet};
pub use crate::schedule::{Schedule, SystemSet};
pub use crate::system::{Res, ResMut};
pub use crate::{prelude::World, system::Resource};

Expand Down Expand Up @@ -724,7 +724,6 @@ mod tests {
use super::*;
// Required to make the derive macro behave
use crate as bevy_ecs;
use crate::event::Events;
use crate::prelude::*;

#[derive(Resource)]
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/schedule/stepping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ impl ScheduleState {
mod tests {
use super::*;
use crate::prelude::*;
use crate::{schedule::ScheduleLabel, world::World};
use crate::schedule::ScheduleLabel;

pub use crate as bevy_ecs;

Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1531,9 +1531,9 @@ mod tests {
use super::*;
use crate::{
self as bevy_ecs, // Necessary for the `SystemParam` Derive when used inside `bevy_ecs`.
system::{assert_is_system, Query},
system::assert_is_system,
};
use std::{cell::RefCell, marker::PhantomData};
use std::cell::RefCell;

// Compile test for https://github.com/bevyengine/bevy/pull/2838.
#[test]
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_math/src/direction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,6 @@ impl approx::UlpsEq for Dir3A {
#[cfg(test)]
mod tests {
use super::*;
use crate::InvalidDirectionError;

#[test]
fn dir2_creation() {
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_math/src/primitives/dim3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,6 @@ mod tests {
// Reference values were computed by hand and/or with external tools

use super::*;
use crate::{InvalidDirectionError, Quat};
use approx::assert_relative_eq;

#[test]
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_reflect/src/path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,6 @@ mod tests {
use super::*;
use crate as bevy_reflect;
use crate::*;
use error::AccessErrorKind;

#[derive(Reflect)]
struct A {
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_render/src/texture/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,6 @@ impl CompressedImageFormats {
#[cfg(test)]
mod test {
use super::*;
use crate::render_asset::RenderAssetUsages;

#[test]
fn image_size() {
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_render/src/texture/image_texture_conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ mod test {
use image::{GenericImage, Rgba};

use super::*;
use crate::render_asset::RenderAssetUsages;

#[test]
fn two_way_conversion() {
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_time/src/common_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ pub fn paused(time: Res<Time<Virtual>>) -> bool {
mod tests {
use super::*;
use bevy_ecs::schedule::{IntoSystemConfigs, Schedule};
use std::time::Duration;

fn test_system() {}

Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_transform/src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,9 @@ mod test {
use bevy_math::{vec3, Vec3};
use bevy_tasks::{ComputeTaskPool, TaskPool};

use crate::components::{GlobalTransform, Transform};
use crate::systems::*;
use crate::TransformBundle;
use bevy_hierarchy::{BuildChildren, BuildWorldChildren, Children, Parent};
use bevy_hierarchy::{BuildChildren, BuildWorldChildren};

#[test]
fn correct_parent_removed() {
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/3d_viewport_to_world.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This example demonstrates how to use the `Camera::viewport_to_world` method.

use bevy::{math::Dir3, prelude::*};
use bevy::prelude::*;

fn main() {
App::new()
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/shadow_caster_receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::f32::consts::PI;

use bevy::{
color::palettes::basic::{BLUE, LIME, RED},
pbr::{light_consts, CascadeShadowConfigBuilder, NotShadowCaster, NotShadowReceiver},
pbr::{CascadeShadowConfigBuilder, NotShadowCaster, NotShadowReceiver},
prelude::*,
};

Expand Down
2 changes: 1 addition & 1 deletion examples/animation/cubic_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use bevy::{
color::palettes::css::{ORANGE, SILVER, WHITE},
math::{cubic_splines::CubicCurve, vec3},
math::vec3,
prelude::*,
};

Expand Down
1 change: 0 additions & 1 deletion examples/animation/custom_skinned_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use std::f32::consts::*;

use bevy::{
pbr::AmbientLight,
prelude::*,
render::{
mesh::{
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/gltf_skinned_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use std::f32::consts::*;

use bevy::{pbr::AmbientLight, prelude::*, render::mesh::skinning::SkinnedMesh};
use bevy::{prelude::*, render::mesh::skinning::SkinnedMesh};

fn main() {
App::new()
Expand Down
2 changes: 1 addition & 1 deletion examples/app/return_after_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! - `App::run()` will never return on iOS and Web.
//! - It is not possible to recreate a window after the event loop has been terminated.

use bevy::{prelude::*, window::WindowPlugin};
use bevy::prelude::*;

fn main() {
println!("Running Bevy App");
Expand Down
2 changes: 1 addition & 1 deletion examples/asset/custom_asset.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Implements loader for a custom asset type.

use bevy::{
asset::{io::Reader, ron, AssetLoader, AsyncReadExt, LoadContext},
asset::{io::Reader, AssetLoader, AsyncReadExt, LoadContext},
prelude::*,
reflect::TypePath,
};
Expand Down
2 changes: 1 addition & 1 deletion examples/ecs/component_change_detection.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This example illustrates how to react to component change.

use bevy::{ecs::world::Ref, prelude::*};
use bevy::prelude::*;
use rand::Rng;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/ecs/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use bevy::prelude::*;
use bevy::{
ecs::{
component::{ComponentDescriptor, ComponentId, ComponentInfo, StorageType},
query::{QueryBuilder, QueryData},
query::QueryData,
world::FilteredEntityMut,
},
ptr::{Aligned, OwningPtr},
Expand Down
1 change: 0 additions & 1 deletion examples/gizmos/light_gizmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::f32::consts::{FRAC_PI_2, PI};

use bevy::{
color::palettes::css::{DARK_CYAN, GOLD, GRAY, PURPLE},
gizmos::light::{LightGizmoColor, LightGizmoConfigGroup},
prelude::*,
};

Expand Down
2 changes: 1 addition & 1 deletion examples/input/char_input_events.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Prints out all chars as they are inputted.

use bevy::{prelude::*, window::ReceivedCharacter};
use bevy::prelude::*;

fn main() {
App::new()
Expand Down
2 changes: 1 addition & 1 deletion examples/input/gamepad_input.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Shows handling of gamepad input, connections, and disconnections.

use bevy::{input::gamepad::GamepadButton, prelude::*};
use bevy::prelude::*;

fn main() {
App::new()
Expand Down
1 change: 0 additions & 1 deletion examples/shader/compute_shader_game_of_life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use bevy::{
renderer::{RenderContext, RenderDevice},
Render, RenderApp, RenderSet,
},
window::WindowPlugin,
};
use std::borrow::Cow;

Expand Down
2 changes: 0 additions & 2 deletions examples/stress_tests/many_animated_sprites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ use std::time::Duration;

use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
math::Quat,
prelude::*,
render::camera::Camera,
window::{PresentMode, WindowResolution},
winit::{UpdateMode, WinitSettings},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/stress_tests/many_buttons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy::{
color::palettes::css::ORANGE_RED,
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
prelude::*,
window::{PresentMode, WindowPlugin, WindowResolution},
window::{PresentMode, WindowResolution},
winit::{UpdateMode, WinitSettings},
};

Expand Down
2 changes: 1 addition & 1 deletion examples/stress_tests/many_glyphs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
prelude::*,
text::{BreakLineOn, Text2dBounds},
window::{PresentMode, WindowPlugin, WindowResolution},
window::{PresentMode, WindowResolution},
winit::{UpdateMode, WinitSettings},
};

Expand Down
2 changes: 1 addition & 1 deletion examples/stress_tests/many_lights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use bevy::{
pbr::{ExtractedPointLight, GlobalLightMeta},
prelude::*,
render::{camera::ScalingMode, Render, RenderApp, RenderSet},
window::{PresentMode, WindowPlugin, WindowResolution},
window::{PresentMode, WindowResolution},
winit::{UpdateMode, WinitSettings},
};
use rand::{thread_rng, Rng};
Expand Down
2 changes: 1 addition & 1 deletion examples/stress_tests/many_sprites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use bevy::{
color::palettes::css::*,
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
prelude::*,
window::{PresentMode, WindowPlugin, WindowResolution},
window::{PresentMode, WindowResolution},
winit::{UpdateMode, WinitSettings},
};

Expand Down
2 changes: 1 addition & 1 deletion examples/stress_tests/text_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
prelude::*,
text::{BreakLineOn, Text2dBounds},
window::{PresentMode, WindowPlugin, WindowResolution},
window::{PresentMode, WindowResolution},
winit::{UpdateMode, WinitSettings},
};

Expand Down
4 changes: 1 addition & 3 deletions examples/tools/gamepad_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
use std::f32::consts::PI;

use bevy::{
input::gamepad::{
GamepadAxisChangedEvent, GamepadButton, GamepadButtonChangedEvent, GamepadSettings,
},
input::gamepad::{GamepadAxisChangedEvent, GamepadButtonChangedEvent, GamepadSettings},
prelude::*,
sprite::{Anchor, MaterialMesh2dBundle, Mesh2dHandle},
};
Expand Down
1 change: 0 additions & 1 deletion examples/tools/scene_viewer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use bevy::{
math::Vec3A,
prelude::*,
render::primitives::{Aabb, Sphere},
window::WindowPlugin,
};

#[path = "../../helpers/camera_controller.rs"]
Expand Down
7 changes: 2 additions & 5 deletions examples/transforms/align.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
//! This example shows how to align the orientations of objects in 3D space along two axes using the `Transform::align` API.

use bevy::color::{
palettes::basic::{GRAY, RED, WHITE},
Color,
};
use bevy::input::mouse::{MouseButton, MouseButtonInput, MouseMotion};
use bevy::color::palettes::basic::{GRAY, RED, WHITE};
use bevy::input::mouse::{MouseButtonInput, MouseMotion};
use bevy::prelude::*;
use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;
Expand Down
4 changes: 2 additions & 2 deletions examples/ui/text_debug.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Shows various text layout options.

use bevy::{
color::palettes::{basic::RED, css::*},
color::palettes::css::*,
diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin},
prelude::*,
window::{PresentMode, WindowPlugin},
window::PresentMode,
};

fn main() {
Expand Down