oh just cargo fmt it all
This commit is contained in:
@@ -1,13 +1,23 @@
|
||||
fn main() {
|
||||
let gifts: [&str;12] = ["A partridge in a pear tree", "Two turtle doves and", "Three french hens ",
|
||||
"Four calling birds", "Five golden rings", "Six geese a-laying", "Seven swans a-swimming",
|
||||
"Eight maids a-milking", "Nine ladies dancing", "Ten lords a-leaping",
|
||||
"Eleven pipers piping", "Twelve drummers drumming" ];
|
||||
let gifts: [&str; 12] = [
|
||||
"A partridge in a pear tree",
|
||||
"Two turtle doves and",
|
||||
"Three french hens ",
|
||||
"Four calling birds",
|
||||
"Five golden rings",
|
||||
"Six geese a-laying",
|
||||
"Seven swans a-swimming",
|
||||
"Eight maids a-milking",
|
||||
"Nine ladies dancing",
|
||||
"Ten lords a-leaping",
|
||||
"Eleven pipers piping",
|
||||
"Twelve drummers drumming",
|
||||
];
|
||||
|
||||
let mut s = String::from(gifts[0]);
|
||||
|
||||
for day in 1..13 {
|
||||
let ending = if day == 1 {
|
||||
let ending = if day == 1 {
|
||||
"st"
|
||||
} else if day == 2 {
|
||||
"nd"
|
||||
@@ -16,10 +26,10 @@ fn main() {
|
||||
};
|
||||
println!("\nOn the {day}{ending} day of Christmas, my true love sent to me");
|
||||
println!("{s}");
|
||||
|
||||
|
||||
if day != 12 {
|
||||
s.insert_str(0,"\n");
|
||||
s.insert_str(0,gifts[day]);
|
||||
s.insert_str(0, "\n");
|
||||
s.insert_str(0, gifts[day]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user