refactor: remove warnings
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
//! Yeah I know, that's kind of weird that it displays
|
//! Yeah I know, that's kind of weird that it displays
|
||||||
//! But it does.........
|
//! But it does.........
|
||||||
|
|
||||||
|
// TODO strum redefine in bevy_controls
|
||||||
|
|
||||||
use bevy::{ecs::schedule::States, prelude::*};
|
use bevy::{ecs::schedule::States, prelude::*};
|
||||||
use bevy_controls::{
|
use bevy_controls::{
|
||||||
contract::InputsContainer,
|
contract::InputsContainer,
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ extern crate proc_macro;
|
|||||||
|
|
||||||
use proc_macro::TokenStream;
|
use proc_macro::TokenStream;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
//use quote::quote;
|
|
||||||
use quote::quote;
|
use quote::quote;
|
||||||
use syn::{
|
use syn::{
|
||||||
parse::{Parse, ParseStream, Result},
|
parse::{Parse, ParseStream, Result},
|
||||||
parse_macro_input,
|
parse_macro_input,
|
||||||
punctuated::Punctuated,
|
punctuated::Punctuated,
|
||||||
token::{Add, Bracket},
|
ItemTrait, LitStr, Token, TypeParamBound,
|
||||||
Expr, Ident, ItemTrait, LitStr, Token, TypeParamBound,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// #[cfg_feature_trait_bounds {
|
// #[cfg_feature_trait_bounds {
|
||||||
@@ -62,8 +60,8 @@ impl Parse for FeatureTraitBoundMap {
|
|||||||
|
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
pub fn cfg_feature_trait_bounds(attr: TokenStream, input: TokenStream) -> TokenStream {
|
pub fn cfg_feature_trait_bounds(attr: TokenStream, input: TokenStream) -> TokenStream {
|
||||||
let rules = parse_macro_input!(attr as FeatureTraitBoundMap);
|
let _rules = parse_macro_input!(attr as FeatureTraitBoundMap);
|
||||||
let input = parse_macro_input!(input as ItemTrait);
|
let _input = parse_macro_input!(input as ItemTrait);
|
||||||
|
|
||||||
dbg!(std::env::vars().map(|(key, _)| key).collect::<Vec<_>>());
|
dbg!(std::env::vars().map(|(key, _)| key).collect::<Vec<_>>());
|
||||||
|
|
||||||
|
|||||||
@@ -2,5 +2,3 @@ pub mod contract;
|
|||||||
pub mod plugin;
|
pub mod plugin;
|
||||||
pub mod resource;
|
pub mod resource;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
pub use util::*;
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
use bevy_app::{App, Plugin, PreUpdate};
|
use bevy_app::{App, Plugin, PreUpdate};
|
||||||
use bevy_derive::{Deref, DerefMut};
|
use bevy_derive::{Deref, DerefMut};
|
||||||
use bevy_ecs::schedule::IntoSystemConfigs;
|
|
||||||
use bevy_ecs::system::{In, IntoSystem};
|
use bevy_ecs::system::{In, IntoSystem};
|
||||||
use bevy_ecs::{
|
use bevy_ecs::{
|
||||||
event::EventReader,
|
event::EventReader,
|
||||||
@@ -141,7 +140,7 @@ impl<A: Action, Ic: InputsContainer<A>, Gs: GameState> ControlsPlugin<A, Ic, Gs>
|
|||||||
|
|
||||||
action_binding_pairs.sort_by(|a, b| b.2.input.len().cmp(&a.2.input.len()));
|
action_binding_pairs.sort_by(|a, b| b.2.input.len().cmp(&a.2.input.len()));
|
||||||
|
|
||||||
'bindings_loop: for (action, config, binding) in action_binding_pairs.iter() {
|
'bindings_loop: for (action, _config, binding) in action_binding_pairs.iter() {
|
||||||
// check binding conditions
|
// check binding conditions
|
||||||
for condition in &binding.conditions {
|
for condition in &binding.conditions {
|
||||||
match condition {
|
match condition {
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ impl<A: Action> PlayerActions<A> {
|
|||||||
self.current.get(&action).unwrap().to_boolean()
|
self.current.get(&action).unwrap().to_boolean()
|
||||||
&& !self.previous.get(&action).unwrap().to_boolean(),
|
&& !self.previous.get(&action).unwrap().to_boolean(),
|
||||||
);
|
);
|
||||||
Err("This input is not boolean".into())
|
//Err("This input is not boolean".into())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set input value to new
|
/// Set input value to new
|
||||||
|
|||||||
Reference in New Issue
Block a user