11use rand:: Rng ;
22use serde:: { Deserialize , Serialize } ;
3- use std:: { collections:: HashMap , ops:: { Index , IndexMut } } ;
3+ use std:: {
4+ collections:: HashMap ,
5+ ops:: { Index , IndexMut } ,
6+ } ;
47
5- use crate :: { game:: structs:: { HealthcareGroup , HealthcareState } } ;
8+ use crate :: game:: structs:: { HealthcareGroup , HealthcareState } ;
69
710#[ macro_export]
811macro_rules! percentage_of {
@@ -150,7 +153,12 @@ impl Date {
150153 }
151154
152155 pub fn get_date_string ( & self ) -> String {
153- format ! ( "{}/{}/{}" , zerofy( self . day, 2 ) , zerofy( self . month, 2 ) , zerofy( self . year, 4 ) )
156+ format ! (
157+ "{}/{}/{}" ,
158+ zerofy( self . day, 2 ) ,
159+ zerofy( self . month, 2 ) ,
160+ zerofy( self . year, 4 )
161+ )
154162 }
155163}
156164
@@ -223,7 +231,9 @@ impl<T: Default + Clone> SlotArray<T> {
223231 }
224232 }
225233
226- pub fn len ( & self ) -> usize { self . array . len ( ) }
234+ pub fn len ( & self ) -> usize {
235+ self . array . len ( )
236+ }
227237}
228238
229239impl < T > Index < usize > for SlotArray < T > {
@@ -240,7 +250,7 @@ impl<T> IndexMut<usize> for SlotArray<T> {
240250}
241251
242252pub fn generate_unemployed_salary ( ) -> i32 {
243- rand:: thread_rng ( ) . gen_range ( 300 ..=1100 )
253+ rand:: thread_rng ( ) . gen_range ( 300 ..=1100 )
244254}
245255
246256pub fn get_healthcare_group ( age : i32 , healthcare : & mut HealthcareState ) -> & mut HealthcareGroup {
@@ -249,4 +259,4 @@ pub fn get_healthcare_group(age: i32, healthcare: &mut HealthcareState) -> &mut
249259 age if age <= 65 => & mut healthcare. adultcare ,
250260 _ => & mut healthcare. eldercare ,
251261 }
252- }
262+ }
0 commit comments