fn testing_year(is_leap_year: bool){
            let leap_year = is_leap_year as u64;

            #[allow(unused_mut)]
            let mut day_number;
            #[allow(unused_mut)]
            let mut month_number;

            for day in 0..(365 + leap_year) {
                if day < 31 { 
                    day_number = day;
                    month_number = 0; 
                } else if day < 59 + leap_year{ 
                    day_number = day - 31;
                    month_number = 1; 
                } else if day < 90 + leap_year { 
                    day_number = day - 59 - leap_year;
                    month_number = 2;  
                } else if day < 120 + leap_year{ 
                    day_number = day - 90 - leap_year;
                    month_number = 3; 
                } else if day < 151 + leap_year{ 
                    day_number = day - 120 - leap_year;
                    month_number = 4; 
                } else if day < 181 + leap_year { 
                    day_number = day - 151 - leap_year;
                    month_number = 5; 
                } else if day < 212 + leap_year{ 
                    day_number = day - 181 - leap_year;
                    month_number = 6; 
                } else if day < 243 + leap_year{ 
                    day_number = day - 212 - leap_year;
                    month_number = 7; 
                } else if day < 273 + leap_year{ 
                    day_number = day - 243 - leap_year;
                    month_number = 8; 
                } else if day < 304 + leap_year{ 
                    day_number = day - 273 - leap_year;
                    month_number = 9; 
                } else if day < 334 + leap_year{ 
                    day_number = day - 304 - leap_year;
                    month_number = 10; 
                } else { 
                    day_number = day - 334 - leap_year;
                    month_number = 11; 
                }

                // Primeiro dia do mês é 1. 
                util_day_constructor(day, is_leap_year, month_number, day_number as u8 + 1)
             }
        }
/// Usa util_day_constructor para testar todos 
/// os dias do ano.
Usa util_day_constructor para testar todos
os dias do ano.
Usa util_day_constructor para testar todos os dias do ano .
fn testing_year(is_leap_year: bool){
            let leap_year = is_leap_year as u64;
            #[allow(unused_mut)]
            let mut day_number;
            #[allow(unused_mut)]
            let mut month_number;
            for day in 0..(365 + leap_year) {
                if day < 31 { 
                    day_number = day;
                    month_number = 0; 
                } else if day < 59 + leap_year{ 
                    day_number = day - 31;
                    month_number = 1; 
                } else if day < 90 + leap_year { 
                    day_number = day - 59 - leap_year;
                    month_number = 2;  
                } else if day < 120 + leap_year{ 
                    day_number = day - 90 - leap_year;
                    month_number = 3; 
                } else if day < 151 + leap_year{ 
                    day_number = day - 120 - leap_year;
                    month_number = 4; 
                } else if day < 181 + leap_year { 
                    day_number = day - 151 - leap_year;
                    month_number = 5; 
                } else if day < 212 + leap_year{ 
                    day_number = day - 181 - leap_year;
                    month_number = 6; 
                } else if day < 243 + leap_year{ 
                    day_number = day - 212 - leap_year;
                    month_number = 7; 
                } else if day < 273 + leap_year{ 
                    day_number = day - 243 - leap_year;
                    month_number = 8; 
                } else if day < 304 + leap_year{ 
                    day_number = day - 273 - leap_year;
                    month_number = 9; 
                } else if day < 334 + leap_year{ 
                    day_number = day - 304 - leap_year;
                    month_number = 10; 
                } else { 
                    day_number = day - 334 - leap_year;
                    month_number = 11; 
                }
                // Primeiro dia do mês é 1. 
                util_day_constructor(day, is_leap_year, month_number, day_number as u8 + 1)
             }
        }
fn testing_year ( is_leap_year : bool ) { let leap_year = is_leap_year as u64 ; # [ allow ( unused_mut ) ] let mut day_number ; # [ allow ( unused_mut ) ] let mut month_number ; for day in 0 .. ( 365 + leap_year ) { if day < 31 { day_number = day ; month_number = 0 ; } else if day < 59 + leap_year { day_number = day - 31 ; month_number = 1 ; } else if day < 90 + leap_year { day_number = day - 59 - leap_year ; month_number = 2 ; } else if day < 120 + leap_year { day_number = day - 90 - leap_year ; month_number = 3 ; } else if day < 151 + leap_year { day_number = day - 120 - leap_year ; month_number = 4 ; } else if day < 181 + leap_year { day_number = day - 151 - leap_year ; month_number = 5 ; } else if day < 212 + leap_year { day_number = day - 181 - leap_year ; month_number = 6 ; } else if day < 243 + leap_year { day_number = day - 212 - leap_year ; month_number = 7 ; } else if day < 273 + leap_year { day_number = day - 243 - leap_year ; month_number = 8 ; } else if day < 304 + leap_year { day_number = day - 273 - leap_year ; month_number = 9 ; } else if day < 334 + leap_year { day_number = day - 304 - leap_year ; month_number = 10 ; } else { day_number = day - 334 - leap_year ; month_number = 11 ; } // Primeiro dia do mês é 1.  util_day_constructor ( day , is_leap_year , month_number , day_number as u8 + 1 ) } }
Usa util_day_constructor para testar todos
os dias do ano.
Usa util_day_constructor para testar todos os dias do ano .
is_leap_year
bool