Skip to content

Commit

Permalink
refactor: rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Carbonhell committed Mar 4, 2024
1 parent 63f9b0b commit a486b34
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 22 deletions.
7 changes: 5 additions & 2 deletions antsforaging/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use krabmaga::bevy::app::{FixedPostUpdate, FixedUpdate};
use krabmaga::bevy::app::FixedUpdate;

Check failure on line 1 in antsforaging/src/main.rs

View workflow job for this annotation

GitHub Actions / Clippy visualization and mpi

failed to resolve: could not find `bevy` in `krabmaga`
#[cfg(not(any(feature = "visualization", feature = "visualization_wasm")))]
use krabmaga::simulate;

Expand Down Expand Up @@ -54,7 +54,10 @@ fn main() {
.with_window_dimensions(1280., 720.)
.with_name("Ants foraging")
.setup::<VisState, ModelState>(VisState, state);
app.add_systems(FixedUpdate, (ToHomeGrid::batch_render, ToFoodGrid::batch_render));
app.add_systems(
FixedUpdate,
(ToHomeGrid::batch_render, ToFoodGrid::batch_render),
);
app.run()
}

Expand Down
9 changes: 4 additions & 5 deletions flockers/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
use crate::model::state::Flocker;

mod model;

// No visualization specific imports
#[cfg(not(any(feature = "visualization", feature = "visualization_wasm")))]
use {
krabmaga::engine::schedule::Schedule, krabmaga::engine::state::State, krabmaga::Info,
krabmaga::*, std::time::Duration,
};

// Visualization specific imports
#[cfg(any(feature = "visualization", feature = "visualization_wasm"))]
use {
crate::visualization::vis_state::VisState, krabmaga::bevy::prelude::Color,
krabmaga::visualization::visualization::Visualization,
};

use crate::model::state::Flocker;

mod model;

#[cfg(any(feature = "visualization", feature = "visualization_wasm"))]
mod visualization;

Expand Down
1 change: 1 addition & 0 deletions flockers_mpi/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use cfg_if::cfg_if;
use krabmaga::cfg_if;

cfg_if! {
if #[cfg(any(feature = "distributed_mpi"))]
{
Expand Down
9 changes: 4 additions & 5 deletions forestfire_bayesian/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#[cfg(any(feature = "bayesian"))]

Check warning on line 1 in forestfire_bayesian/src/main.rs

View workflow job for this annotation

GitHub Actions / Clippy visualization and mpi

unneeded sub `cfg` when there is only one condition

Check warning on line 1 in forestfire_bayesian/src/main.rs

View workflow job for this annotation

GitHub Actions / Clippy visualization and mpi

unneeded sub `cfg` when there is only one condition
use krabmaga::{engine::schedule::Schedule, engine::state::State, explore::bayesian::*};
use krabmaga::{rand::prelude::*, *};

// Global imports (needed for the simulation to run)
use crate::model::forest::Forest;
use crate::model::forest::Tree;

mod model;

#[cfg(any(feature = "bayesian"))]
use krabmaga::{engine::schedule::Schedule, engine::state::State, explore::bayesian::*};

use krabmaga::{rand::prelude::*, *};

pub const ITERATIONS: usize = 10;
pub const INIT_ELEMENTS: usize = 4;
pub const BATCH_SIZE: usize = 200;
Expand Down
2 changes: 1 addition & 1 deletion schelling/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use krabmaga::bevy::app::FixedUpdate;
#[cfg(not(any(feature = "visualization", feature = "visualization_wasm")))]
use krabmaga::*;
use krabmaga::bevy::app::FixedUpdate;

// Visualization specific imports
#[cfg(any(feature = "visualization", feature = "visualization_wasm"))]
Expand Down
2 changes: 1 addition & 1 deletion sugarscape/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use krabmaga::*;
use krabmaga::bevy::prelude::FixedUpdate;

Check failure on line 1 in sugarscape/src/main.rs

View workflow job for this annotation

GitHub Actions / Clippy visualization and mpi

failed to resolve: could not find `bevy` in `krabmaga`
use krabmaga::*;

#[cfg(any(feature = "visualization", feature = "visualization_wasm"))]
use {
Expand Down
9 changes: 5 additions & 4 deletions template/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Global imports (needed for the simulation to run)
use crate::model::sea::Sea;
mod model;

#[cfg(not(any(feature = "visualization", feature = "visualization_wasm")))]
use krabmaga::*;

Expand All @@ -12,6 +8,11 @@ use {
krabmaga::visualization::visualization::Visualization,
};

// Global imports (needed for the simulation to run)
use crate::model::sea::Sea;

mod model;

#[cfg(any(feature = "visualization", feature = "visualization_wasm"))]
mod visualization;

Expand Down
5 changes: 2 additions & 3 deletions virusnetwork/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
extern crate krabmaga;

use krabmaga::bevy::prelude::FixedUpdate;

Check failure on line 3 in virusnetwork/src/main.rs

View workflow job for this annotation

GitHub Actions / Clippy visualization and mpi

failed to resolve: could not find `bevy` in `krabmaga`
#[cfg(not(any(feature = "visualization", feature = "visualization_wasm")))]
use krabmaga::*;
use krabmaga::bevy::prelude::FixedUpdate;

// Visualization specific imports
use model::state::EpidemicNetworkState;
#[cfg(any(feature = "visualization", feature = "visualization_wasm"))]
use {
crate::visualization::vis_state::VisState, krabmaga::bevy::prelude::Color,
krabmaga::visualization::fields::network::NetworkRender,
krabmaga::visualization::visualization::Visualization,
};
use model::state::EpidemicNetworkState;

mod model;

Expand Down
2 changes: 1 addition & 1 deletion wolfsheepgrass/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// No visualization specific imports
#[cfg(not(any(feature = "visualization", feature = "visualization_wasm")))]
use krabmaga::*;
// No visualization specific imports
use krabmaga::bevy::prelude::FixedUpdate;

#[cfg(any(feature = "visualization", feature = "visualization_wasm"))]
Expand Down

0 comments on commit a486b34

Please sign in to comment.