Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
17
third-party/vendor/generator/examples/fib.rs
vendored
Normal file
17
third-party/vendor/generator/examples/fib.rs
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use generator::{done, Gn};
|
||||
|
||||
fn main() {
|
||||
let g = Gn::new_scoped(|mut s| {
|
||||
let (mut a, mut b) = (0, 1);
|
||||
while b < 200 {
|
||||
std::mem::swap(&mut a, &mut b);
|
||||
b += a;
|
||||
s.yield_(b);
|
||||
}
|
||||
done!();
|
||||
});
|
||||
|
||||
for i in g {
|
||||
println!("{i}");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue