Skip to content

Fix generator usage #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@
//! #[macro_use(await)]
//! extern crate nb;
Comment on lines 298 to 299
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should modernize this, too, while we are at it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Rust 2018 it does not build due to await being a reserved keyword.

//!
//! use std::ops::Generator;
//! extern crate core;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! extern crate core;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not compile otherwise.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superweird. Probably needs a thourough overhaul.

//! use core::ops::Generator;
//! use core::pin::Pin;
//!
//! use hal::{Led, Serial, Timer};
//!
Expand Down Expand Up @@ -327,10 +329,12 @@
//! }
//! };
//!
//! let blinky = Pin::new(&mut blinky);
//! let loopback = Pin::new(&mut loopback);
//! // Event loop
//! loop {
//! blinky.resume();
//! loopback.resume();
//! blinky.resume(());
//! loopback.resume(());
//! # break
//! }
//! }
Expand Down