Skip to content

Commit

Permalink
Clean up doc tests for
Browse files Browse the repository at this point in the history
  • Loading branch information
speelbarrow committed Oct 25, 2023
1 parent 438a0ea commit 0910095
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Move the logic for the `entry` macro into [`entry.rs`
](https://github.com/speelbarrow/weensy.rs/blob/proc-macro/src/entry.rs#L12), replace with a stub in [`lib.rs`
](https://github.com/speelbarrow/weensy.rs/blob/proc-macro/src/lib.rs#L45)
- Clean up [doctests for the `entry` macro](https://github.com/speelbarrow/weensy.rs/blob/proc-macro/src/lib.rs#L10)

### [v0.1.2](https://github.com/speelbarrow/weensy.rs/blob/v0.1.2)
- Fix [verification of function signature by `entry` attribute
Expand Down
21 changes: 4 additions & 17 deletions proc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,22 @@ Configures your `main` function to be exported properly.
Arguments may be passed to the attribute which will then be used to unpack the [resources] returned by the [`t41`]
bootstraper.
```
# #![no_main]
``` no_run
use weensy::{init, entry};
#[entry(usb, mut gpio2, pins[mut 12, 13])]
# #[export_name = "_not_main"]
fn main() -> ! {
init::log(usb);
// ...
# loop{}
# }
# #[export_name = "main"]
# fn _main() -> i32 {
# 0
# panic!()
# }
```
``` compile_fail
# #![no_main]
``` compile_fail no_run
use weensy::entry;
#[entry]
# #[export_name = "_not_main"]
// Signature must be `fn main() -> !`
fn main() {
fn main() { // Signature must be `fn main() -> !`
// ...
# loop{}
# }
# #[export_name = "main"]
# fn _main() -> i32 {
# 0
# }
```
[resources]: teensy4_bsp::board::Resources
Expand Down

0 comments on commit 0910095

Please sign in to comment.