Skip to content

Commit

Permalink
fixed clippy warnings + project template
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed May 16, 2024
1 parent 19d1af0 commit af4156a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
10 changes: 1 addition & 9 deletions fyrox-impl/src/scene/node/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,11 @@ pub struct NodeConstructor {
}

/// A special container that is able to create nodes by their type UUID.

#[derive(Default)]
pub struct NodeConstructorContainer {
map: Mutex<FxHashMap<Uuid, NodeConstructor>>,
}

impl Default for NodeConstructorContainer {
fn default() -> Self {
Self {
map: Default::default(),
}
}
}

impl NodeConstructorContainer {
/// Creates default node constructor container with constructors for built-in engine nodes.
pub fn new() -> Self {
Expand Down
9 changes: 1 addition & 8 deletions fyrox-impl/src/script/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,12 @@ pub struct ScriptConstructor {
}

/// A special container that is able to create nodes by their type UUID.
#[derive(Default)]
pub struct ScriptConstructorContainer {
// BTreeMap allows to have sorted list of constructors.
map: Mutex<BTreeMap<Uuid, ScriptConstructor>>,
}

impl Default for ScriptConstructorContainer {
fn default() -> Self {
Self {
map: Default::default(),
}
}
}

impl ScriptConstructorContainer {
/// Creates default node constructor container with constructors for built-in engine nodes.
pub fn new() -> Self {
Expand Down
4 changes: 2 additions & 2 deletions template/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ dylib-engine = ["fyrox/dylib"]
base_path.join("game/src/lib.rs"),
r#"//! Game project.
use fyrox::{
core::pool::Handle, core::visitor::prelude::*,
core::pool::Handle, core::visitor::prelude::*, core::reflect::prelude::*,
event::Event,
gui::message::UiMessage,
plugin::{Plugin, PluginContext, PluginRegistrationContext},
Expand All @@ -173,7 +173,7 @@ use std::path::Path;
// Re-export the engine.
pub use fyrox;
#[derive(Default, Visit)]
#[derive(Default, Visit, Reflect)]
pub struct Game {
scene: Handle<Scene>,
}
Expand Down

0 comments on commit af4156a

Please sign in to comment.