2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,13 +1,12 @@
|
|||
#![feature(into_cow)]
|
||||
use std::borrow::IntoCow;
|
||||
|
||||
use std::borrow::Cow;
|
||||
fn main() {
|
||||
for i in 1..101 {
|
||||
println!("{}", match (i%3, i%5) {
|
||||
(0,0) => "FizzBuzz".into_cow(),
|
||||
(0,_) => "Fizz".into_cow(),
|
||||
(_,0) => "Buzz".into_cow(),
|
||||
_ => i.to_string().into_cow(),
|
||||
});
|
||||
let word: Cow<_> = match (i % 3, i % 5) {
|
||||
(0,0) => "FizzBuzz".into(),
|
||||
(0,_) => "Fizz".into(),
|
||||
(_, 0) => "Buzz".into(),
|
||||
_ => i.to_string().into(),
|
||||
};
|
||||
println!("{}", word);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue