22
33use crate :: buttonlike:: ButtonValue ;
44use crate :: input_map:: UpdatedValue ;
5- use crate :: { action_diff:: ActionDiff , input_map:: UpdatedActions } ;
65use crate :: { Actionlike , InputControlKind } ;
6+ use crate :: { action_diff:: ActionDiff , input_map:: UpdatedActions } ;
77
88use bevy:: platform:: { collections:: HashMap , time:: Instant } ;
99use bevy:: prelude:: Resource ;
@@ -310,7 +310,7 @@ impl<A: Actionlike> ActionState<A> {
310310 pub fn button_data_mut ( & mut self , action : & A ) -> Option < & mut ButtonData > {
311311 match self . action_data_mut ( action) {
312312 Some ( action_data) => match & mut action_data. kind_data {
313- ActionKindData :: Button ( ref mut button_data) => Some ( button_data) ,
313+ ActionKindData :: Button ( button_data) => Some ( button_data) ,
314314 _ => None ,
315315 } ,
316316 None => None ,
@@ -380,7 +380,7 @@ impl<A: Actionlike> ActionState<A> {
380380 pub fn axis_data_mut ( & mut self , action : & A ) -> Option < & mut AxisData > {
381381 match self . action_data_mut ( action) {
382382 Some ( action_data) => match & mut action_data. kind_data {
383- ActionKindData :: Axis ( ref mut axis_data) => Some ( axis_data) ,
383+ ActionKindData :: Axis ( axis_data) => Some ( axis_data) ,
384384 _ => None ,
385385 } ,
386386 None => None ,
@@ -453,7 +453,7 @@ impl<A: Actionlike> ActionState<A> {
453453
454454 match self . action_data_mut ( action) {
455455 Some ( action_data) => match & mut action_data. kind_data {
456- ActionKindData :: DualAxis ( ref mut dual_axis_data) => Some ( dual_axis_data) ,
456+ ActionKindData :: DualAxis ( dual_axis_data) => Some ( dual_axis_data) ,
457457 _ => None ,
458458 } ,
459459 None => None ,
@@ -526,7 +526,7 @@ impl<A: Actionlike> ActionState<A> {
526526
527527 match self . action_data_mut ( action) {
528528 Some ( action_data) => match & mut action_data. kind_data {
529- ActionKindData :: TripleAxis ( ref mut triple_axis_data) => Some ( triple_axis_data) ,
529+ ActionKindData :: TripleAxis ( triple_axis_data) => Some ( triple_axis_data) ,
530530 _ => None ,
531531 } ,
532532 None => None ,
@@ -1370,9 +1370,9 @@ mod tests {
13701370 fn press_lifecycle ( ) {
13711371 use std:: time:: { Duration , Instant } ;
13721372
1373- use crate :: prelude:: updating:: CentralInputStore ;
13741373 use crate :: prelude:: Buttonlike ;
13751374 use crate :: prelude:: ClashStrategy ;
1375+ use crate :: prelude:: updating:: CentralInputStore ;
13761376
13771377 let ctx = TestContext :: new ( ) ;
13781378 let mut app = ctx. app ;
@@ -1466,8 +1466,8 @@ mod tests {
14661466 fn update_with_clashes_prioritizing_longest ( ) {
14671467 use std:: time:: { Duration , Instant } ;
14681468
1469- use crate :: prelude:: updating:: CentralInputStore ;
14701469 use crate :: prelude:: ClashStrategy ;
1470+ use crate :: prelude:: updating:: CentralInputStore ;
14711471 use crate :: user_input:: Buttonlike ;
14721472 use bevy:: prelude:: KeyCode :: * ;
14731473
@@ -1780,17 +1780,21 @@ mod tests {
17801780 } ) ,
17811781 } ,
17821782 ) ;
1783- assert ! ( action_state
1784- . dual_axis_data_mut( & TestAction :: DualAxis )
1785- . is_some( ) ) ;
1783+ assert ! (
1784+ action_state
1785+ . dual_axis_data_mut( & TestAction :: DualAxis )
1786+ . is_some( )
1787+ ) ;
17861788 }
17871789
17881790 #[ test]
17891791 fn test_dual_axis_data_mut_for_dual_axis_action_without_data ( ) {
17901792 let mut action_state = ActionState :: < TestAction > :: default ( ) ;
1791- assert ! ( action_state
1792- . dual_axis_data_mut( & TestAction :: DualAxis )
1793- . is_none( ) ) ;
1793+ assert ! (
1794+ action_state
1795+ . dual_axis_data_mut( & TestAction :: DualAxis )
1796+ . is_none( )
1797+ ) ;
17941798 }
17951799
17961800 #[ test]
@@ -1803,9 +1807,11 @@ mod tests {
18031807 #[ test]
18041808 fn test_triple_axis_data_for_triple_axis_action_without_data ( ) {
18051809 let action_state = ActionState :: < TestAction > :: default ( ) ;
1806- assert ! ( action_state
1807- . triple_axis_data( & TestAction :: TripleAxis )
1808- . is_none( ) ) ;
1810+ assert ! (
1811+ action_state
1812+ . triple_axis_data( & TestAction :: TripleAxis )
1813+ . is_none( )
1814+ ) ;
18091815 }
18101816
18111817 #[ test]
@@ -1822,9 +1828,11 @@ mod tests {
18221828 } ) ,
18231829 } ,
18241830 ) ;
1825- assert ! ( action_state
1826- . triple_axis_data_mut( & TestAction :: TripleAxis )
1827- . is_some( ) ) ;
1831+ assert ! (
1832+ action_state
1833+ . triple_axis_data_mut( & TestAction :: TripleAxis )
1834+ . is_some( )
1835+ ) ;
18281836 }
18291837
18301838 #[ test]
0 commit comments