add functional feature

This commit is contained in:
iosmanthus 2018-12-10 10:12:53 +08:00
parent dcb487b9e7
commit 6932e61bc2

12
e.rs
View File

@ -1,7 +1,15 @@
#![feature(main)]
#[main]
#[cfg(feature = "functional")]
fn e() {
std::iter::repeat('e').for_each(|e| print!("{}", e))
}
#[cfg(not(feature = "functional"))]
fn e() {
loop {
print!("e");
}
}
fn main() {
e();
}