Skip to content

Commit

Permalink
feat: mods allow unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchantey committed Jan 17, 2024
1 parent 7299afd commit f645010
Show file tree
Hide file tree
Showing 153 changed files with 211 additions and 66 deletions.
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/bevy_utils/_camera/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod raw_projection;
pub use self::raw_projection::*;
pub mod create_views;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/bevy_utils/_input_source/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod webxr_input_profiles;
pub use self::webxr_input_profiles::*;
pub mod insert_input_sources;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/bevy_utils/_materials/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod replace_standard_material;
pub use self::replace_standard_material::*;
pub mod unlit_material;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/bevy_utils/_plugins/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod run_bevy_webxr;
pub use self::run_bevy_webxr::*;
pub mod webxr_plugin;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/bevy_utils/_xr/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod conversion;
pub use self::conversion::*;
pub mod update_xr_resources;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/bevy_utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod _plugins;
pub use self::_plugins::*;
pub mod _camera;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/bevy_web_asset/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod web_asset_io;
pub use self::web_asset_io::*;
pub mod web_asset_plugin;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/demo/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod demo_scene_plugin;
pub use self::demo_scene_plugin::*;
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod web_sys_utils;
pub use self::web_sys_utils::*;
pub mod math;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_webxr/src/xr_utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod webgl_context;
pub use self::webgl_context::*;
pub mod test;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_ai/src/chat/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod chat_gpt;
pub use self::chat_gpt::*;
pub mod llm;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_ai/test/chat/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#![allow(unused_imports)]
1 change: 1 addition & 0 deletions crates/forky/forky_ai/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![allow(unused_imports)]
pub mod chat;
1 change: 1 addition & 0 deletions crates/forky/forky_bevy/src/components/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod orphan_children;
pub use self::orphan_children::*;
1 change: 1 addition & 0 deletions crates/forky/forky_bevy/src/extensions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod vec;
pub use self::vec::*;
pub mod transform_x;
Expand Down
2 changes: 1 addition & 1 deletion crates/forky/forky_bevy/src/extensions/vec.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bevy_math::prelude::*;
use extend::ext;
use forky_core::utility::random_value;
use forky_core::prelude::*;

#[ext]
pub impl Vec3 {
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_bevy/test/extensions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod app;
pub use self::app::*;
pub mod quat;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_bevy/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![allow(unused_imports)]
pub mod extensions;
1 change: 1 addition & 0 deletions crates/forky/forky_cli/src/auto_mod/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod command;
pub use self::command::*;
pub mod run;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_cli/src/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod auto_fs;
pub use self::auto_fs::*;
pub mod forky_cli;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_cli/src/server/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod proxy;
pub use self::proxy::*;
pub mod tls;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_cli/src/style/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod command_all;
pub use self::command_all::*;
pub mod lightning;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_cli/src/watch/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod command;
pub use self::command::*;
pub mod run;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_cli/test/files/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod auto_mod;
pub use self::auto_mod::*;
pub mod test_dir;
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod test_mod;
pub mod _test_use;
pub use self::_test_use::*;
1 change: 1 addition & 0 deletions crates/forky/forky_cli/test/files/test_dir/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod test_mod;
pub use self::test_mod::*;
pub mod __test_sub_dir;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_cli/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![allow(unused_imports)]
pub mod files;
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/extensions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod num_x;
pub use self::num_x::*;
pub mod path_buf;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/forky_event/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod forky_event;
pub use self::forky_event::*;
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/graph/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod node;
pub use self::node::*;
4 changes: 2 additions & 2 deletions crates/forky/forky_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub mod forky_event;
pub use self::forky_event::*;
pub use self::utils::*;
pub mod macros;
pub use self::macros::macros_inner::*;
// pub use self::macros::*;
pub mod net;


Expand All @@ -19,7 +19,7 @@ pub mod prelude {
pub use crate::forky_event::*;
pub use crate::graph::*;
pub use crate::macros::*;
pub use crate::math::*;
// pub use crate::math::*;
// pub use crate::math_f64::*;
pub use crate::net::*;
pub use crate::utility::*;
Expand Down
82 changes: 40 additions & 42 deletions crates/forky/forky_core/src/macros/macros.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
//https://danielkeep.github.io/tlborm/book/pat-repetition-replacement.html

/// Container for macros
pub mod macros_inner {
#[macro_export]
macro_rules! replace_expr {
($_t:tt $sub:expr) => {
$sub
};
}
#[macro_export]
macro_rules! replace_expr {
($_t:tt $sub:expr) => {
$sub
};
}

// #[macro_export]
// macro_rules! fmt {
// ($($x:expr) +) => {
// $(format!("{} ",$x))+
// };
// }
// #[macro_export]
// macro_rules! log {
// ($($x:expr) +) => {
// $(print!("{}",$x));+;
// print!("\n");
// };
// }
#[macro_export]
macro_rules! log {
// #[macro_export]
// macro_rules! fmt {
// ($($x:expr) +) => {
// $(format!("{} ",$x))+
// };
// }
// #[macro_export]
// macro_rules! log {
// ($($x:expr) +) => {
// $(print!("{}",$x));+;
// print!("\n");
// };
// }
#[macro_export]
macro_rules! log {
( $( $t:tt )* ) => {
#[cfg(not(target_arch = "wasm32"))]
println!($( $t )*);
Expand All @@ -32,27 +31,27 @@ pub mod macros_inner {
}
}

#[macro_export]
macro_rules! dir {
#[macro_export]
macro_rules! dir {
($($x:expr) +) => {
$(print!("{:#?}",$x));+;
print!("\n");
};
}

#[macro_export]
macro_rules! tern {
($pred:expr; $a:expr; $b:expr) => {
if $pred {
$a
} else {
$b
}
};
}
#[macro_export]
macro_rules! tern {
($pred:expr; $a:expr; $b:expr) => {
if $pred {
$a
} else {
$b
}
};
}

#[macro_export]
macro_rules! spacecat {
#[macro_export]
macro_rules! spacecat {
// ($single_item:expr) => {
// $single_item
// };
Expand All @@ -64,9 +63,8 @@ pub mod macros_inner {
};
}

// macro_rules! fmt {
// ($($x:expr) +) => {
// [$(replace_expr!($x "{}")),+].join("baz")
// };
// }
}
// macro_rules! fmt {
// ($($x:expr) +) => {
// [$(replace_expr!($x "{}")),+].join("baz")
// };
// }
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/macros/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod macros;
pub use self::macros::*;
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/math/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod funcs;
pub use self::funcs::*;
pub mod constants;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/math_f64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod funcs;
pub use self::funcs::*;
pub mod constants;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/net/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod url;
pub use self::url::*;
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/style/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#![allow(unused_imports)]
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/utility/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod random;
pub use self::random::*;
pub mod time;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_core/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod drop_utils;
pub use self::drop_utils::*;
pub mod async_utils;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_core/test/extensions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod vec;
pub use self::vec::*;
pub mod str_x;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_core/test/forky_event/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod forky_event;
pub use self::forky_event::*;
1 change: 1 addition & 0 deletions crates/forky/forky_core/test/graph/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod graph;
pub use self::graph::*;
1 change: 1 addition & 0 deletions crates/forky/forky_core/test/math/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod constants;
pub use self::constants::*;
1 change: 1 addition & 0 deletions crates/forky/forky_core/test/misc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod macros;
pub use self::macros::*;
1 change: 1 addition & 0 deletions crates/forky/forky_core/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod graph;
pub mod misc;
pub mod pointers;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_core/test/pointers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod threads;
pub use self::threads::*;
1 change: 1 addition & 0 deletions crates/forky/forky_esp/src/__extensions/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![allow(unused_imports)]
pub mod rgb;
1 change: 1 addition & 0 deletions crates/forky/forky_esp/src/_core/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod _timer;
pub mod _smart_leds_adapter_rgbw;
pub mod _esp_device;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_esp/src/entry/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod hello_led;
pub use self::hello_led::*;
pub mod hello_world;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_fs/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod fs_watcher;
pub use self::fs_watcher::*;
pub mod subcommand;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_fs/src/utility/cli_args/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(unused_imports)]
pub mod misc;
pub use self::misc::*;
28 changes: 13 additions & 15 deletions crates/forky/forky_fs/src/utility/fs/macros.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
pub mod macros_inner {
#[macro_export]
macro_rules! file_abs {
() => {
std::path::Path::new(env!("CARGO_MANIFEST_DIR").join(file!()))
};
}
#[macro_export]
macro_rules! file_abs {
() => {
std::path::Path::new(env!("CARGO_MANIFEST_DIR").join(file!()))
};
}

#[macro_export]
macro_rules! file_abs_workspace {
() => {
std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join(
forky_core::PathBufExt::pop_first_two_path_components(file!()),
)
};
}
#[macro_export]
macro_rules! file_abs_workspace {
() => {
std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join(
forky_core::PathBufExt::pop_first_two_path_components(file!()),
)
};
}
1 change: 1 addition & 0 deletions crates/forky/forky_fs/src/utility/fs/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod file;
pub use self::file::*;
pub mod dir;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_fs/src/utility/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod terminal;
pub mod fs;
pub mod process;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_fs/src/utility/process/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod child_x;
pub use self::child_x::*;
pub mod command;
Expand Down
1 change: 1 addition & 0 deletions crates/forky/forky_fs/src/utility/terminal/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
pub mod misc;
pub use self::misc::*;
pub mod redirect_io;
Expand Down
Loading

0 comments on commit f645010

Please sign in to comment.