Unverified Commit 5f02ddbd authored by Aral Balkan's avatar Aral Balkan
Browse files

Fix all warnings

parent b96c2652
......@@ -16,23 +16,20 @@ fn display_lyrics_for_day(day: u32) {
let details = days_to_presents[day as usize];
let dayInEnglish = details.0;
let mut presentForDayInEnglish: &str;
let day_in_english = details.0;
let present_for_day_in_english: &str;
if day == 0 {
presentForDayInEnglish = "A patridge in a pear tree.";
present_for_day_in_english = "A patridge in a pear tree.";
} else {
presentForDayInEnglish = details.1;
present_for_day_in_english = details.1;
}
println!("\nOn the {} day of Christmas, my true love sent to me\n{}", dayInEnglish, presentForDayInEnglish);
println!("\nOn the {} day of Christmas, my true love sent to me\n{}", day_in_english, present_for_day_in_english);
days_to_presents.reverse();
for (index, details) in days_to_presents.iter().enumerate() {
//println!("Index: {}", index);
//println!("Len: {}", days_to_presents.len());
//println!("Day: {}", day);
if index > days_to_presents.len() - day as usize - 1 {
println!("{}", details.1);
}
......@@ -42,9 +39,8 @@ fn display_lyrics_for_day(day: u32) {
fn main() {
for day in (0..12) {
// Display the lyrics for the twelve days.
for day in 0..12 {
display_lyrics_for_day(day);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment