Skip to content

Commit

Permalink
Run cargo fmt with nightly flags (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
djeedai authored Jun 22, 2024
1 parent e4e5d25 commit 0938852
Show file tree
Hide file tree
Showing 43 changed files with 195 additions and 209 deletions.
3 changes: 1 addition & 2 deletions examples/2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ use bevy::{
},
sprite::{MaterialMesh2dBundle, Mesh2dHandle},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
Expand Down
3 changes: 1 addition & 2 deletions examples/activate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ use bevy::{
camera::ScalingMode, render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin,
},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
Expand Down
3 changes: 1 addition & 2 deletions examples/billboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ use bevy::{
camera::Projection, render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin,
},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
Expand Down
3 changes: 1 addition & 2 deletions examples/circle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ use bevy::{
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

mod texutils;

use texutils::make_anim_img;
Expand Down
3 changes: 1 addition & 2 deletions examples/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ use bevy::{
log::LogPlugin,
prelude::*,
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut app = App::default();
app.add_plugins(
Expand Down
3 changes: 1 addition & 2 deletions examples/firework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ use bevy::{
log::LogPlugin,
prelude::*,
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut app = App::default();
app.add_plugins(
Expand Down
3 changes: 1 addition & 2 deletions examples/force_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ use bevy::{
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
Expand Down
6 changes: 3 additions & 3 deletions examples/gradient.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::f32::consts::PI;

use bevy::{
core_pipeline::tonemapping::Tonemapping,
log::LogPlugin,
Expand All @@ -6,11 +8,9 @@ use bevy::{
render_resource::WgpuFeatures, settings::WgpuSettings, view::RenderLayers, RenderPlugin,
},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;
use std::f32::consts::PI;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
Expand Down
3 changes: 1 addition & 2 deletions examples/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ use bevy::{
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

#[derive(Component)]
struct RotateSpeed(pub f32);

Expand Down
3 changes: 1 addition & 2 deletions examples/instancing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
#![allow(dead_code)]

use bevy::{core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;
use rand::Rng;

use bevy_hanabi::prelude::*;

#[derive(Default, Resource)]
struct InstanceManager {
effect: Handle<EffectAsset>,
Expand Down
3 changes: 1 addition & 2 deletions examples/lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ use bevy::{
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
Expand Down
3 changes: 1 addition & 2 deletions examples/multicam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ use bevy::{
render::{camera::Viewport, view::RenderLayers},
window::WindowResized,
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() {
let mut app = App::default();
app.add_plugins(
Expand Down
1 change: 0 additions & 1 deletion examples/ordering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use bevy::{
log::LogPlugin,
prelude::*,
};

use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;
Expand Down
3 changes: 1 addition & 2 deletions examples/portal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ use bevy::{
log::LogPlugin,
prelude::*,
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut app = App::default();
app.add_plugins(
Expand Down
3 changes: 1 addition & 2 deletions examples/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ use bevy::{
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
Expand Down
1 change: 0 additions & 1 deletion examples/ribbon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use bevy::{
math::vec3,
};
use bevy_hanabi::prelude::*;

#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

Expand Down
3 changes: 1 addition & 2 deletions examples/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ use bevy::{
RenderPlugin,
},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

/// Set this to `true` to enable WGPU downlevel constraints. This is disabled by
/// default to prevent the example from failing to start on devices with a
/// monitor resolution larger than the maximum resolution imposed by the
Expand Down
3 changes: 1 addition & 2 deletions examples/spawn_on_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ use bevy::{
RenderPlugin,
},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
Expand Down
3 changes: 1 addition & 2 deletions examples/visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ use bevy::{
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
Expand Down
3 changes: 1 addition & 2 deletions examples/worms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ use bevy::{
math::{vec3, vec4},
prelude::*,
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

use bevy_hanabi::prelude::*;

fn main() {
let mut app = App::default();
app.add_plugins(
Expand Down
1 change: 0 additions & 1 deletion gpu_tests/empty_effect.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Test that an empty (invalid) bundle doesn't produce any error.
use bevy::{app::AppExit, core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*};

use bevy_hanabi::prelude::*;

#[derive(Default, Resource)]
Expand Down
6 changes: 3 additions & 3 deletions src/asset.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use std::ops::Deref;

use bevy::{
asset::{io::Reader, Asset, AssetLoader, AsyncReadExt, LoadContext},
reflect::Reflect,
utils::{default, thiserror::Error, BoxedFuture, HashSet},
};
use serde::{Deserialize, Serialize};
use std::ops::Deref;

use crate::{
modifier::{Modifier, RenderModifier},
Expand Down Expand Up @@ -720,9 +721,8 @@ impl AssetLoader for EffectAssetLoader {
mod tests {
use ron::ser::PrettyConfig;

use crate::*;

use super::*;
use crate::*;

#[test]
fn add_modifiers() {
Expand Down
14 changes: 5 additions & 9 deletions src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ impl std::hash::Hash for AttributeInner {
}

macro_rules! declare_custom_attr_inner {
($t: ident, $T: ty, $name: literal, $new_fn: ident) => {
($t:ident, $T:ty, $name:literal, $new_fn:ident) => {
pub const $t: &'static AttributeInner = &AttributeInner::new(
Cow::Borrowed($name),
Value::Vector(VectorValue::$new_fn(<$T>::ZERO)),
Expand Down Expand Up @@ -1289,9 +1289,7 @@ impl ParticleLayoutBuilder {
///
/// ```
/// # use bevy_hanabi::*;
/// let layout = ParticleLayout::new()
/// .append(Attribute::POSITION)
/// .build();
/// let layout = ParticleLayout::new().append(Attribute::POSITION).build();
/// ```
pub fn build(mut self) -> ParticleLayout {
// Remove duplicates
Expand Down Expand Up @@ -1575,9 +1573,7 @@ impl ParticleLayout {
///
/// ```
/// # use bevy_hanabi::*;
/// let layout = ParticleLayout::new()
/// .append(Attribute::SIZE)
/// .build();
/// let layout = ParticleLayout::new().append(Attribute::SIZE).build();
/// let has_size = layout.contains(Attribute::SIZE);
/// assert!(has_size);
/// ```
Expand Down Expand Up @@ -1610,11 +1606,11 @@ impl ParticleLayout {

#[cfg(test)]
mod tests {
use super::*;

use bevy::reflect::TypeRegistration;
use naga::{front::wgsl::Frontend, proc::Layouter};

use super::*;

// Ensure the size and alignment of all types conforms to the WGSL spec by
// querying naga as a reference.
#[test]
Expand Down
3 changes: 2 additions & 1 deletion src/bundle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{CompiledParticleEffect, EffectAsset, EffectProperties, ParticleEffect};
use bevy::prelude::*;

use crate::{CompiledParticleEffect, EffectAsset, EffectProperties, ParticleEffect};

/// A component bundle for a particle effect.
///
/// This bundle contains all necessary components for a [`ParticleEffect`] to
Expand Down
6 changes: 3 additions & 3 deletions src/gradient.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use std::hash::{Hash, Hasher};

use bevy::{
math::{Quat, Vec2, Vec3, Vec3A, Vec4},
reflect::{FromReflect, Reflect},
utils::FloatOrd,
};
use serde::{Deserialize, Serialize};
use std::hash::{Hash, Hasher};

/// Describes a type that can be linearly interpolated between two keys.
///
Expand Down Expand Up @@ -484,9 +485,8 @@ mod tests {
use bevy::reflect::{ReflectRef, Struct};
use rand::{distributions::Standard, prelude::Distribution, rngs::ThreadRng, thread_rng, Rng};

use crate::test_utils::*;

use super::*;
use crate::test_utils::*;

const RED: Vec4 = Vec4::new(1., 0., 0., 1.);
const BLUE: Vec4 = Vec4::new(0., 0., 1., 1.);
Expand Down
Loading

0 comments on commit 0938852

Please sign in to comment.