mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
book: detail import resolving for 0.6 migration
This commit is contained in:
parent
374a1c2add
commit
cfc97488db
1 changed files with 40 additions and 1 deletions
|
@ -30,7 +30,46 @@ mod app {
|
||||||
|
|
||||||
Now that a regular Rust module is used it means it is possible to have custom
|
Now that a regular Rust module is used it means it is possible to have custom
|
||||||
user code within that module.
|
user code within that module.
|
||||||
Additionally, it means that `use`-statements for resources etc may be required.
|
Additionally, it means that `use`-statements for resources used in user
|
||||||
|
code must be moved inside `mod app`, or be referred to with `super`. For
|
||||||
|
example, change:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
use some_crate::some_func;
|
||||||
|
|
||||||
|
#[rtic::app(/* .. */)]
|
||||||
|
const APP: () = {
|
||||||
|
fn func() {
|
||||||
|
some_crate::some_func();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
into
|
||||||
|
|
||||||
|
```rust
|
||||||
|
#[rtic::app(/* .. */)]
|
||||||
|
mod app {
|
||||||
|
use some_crate::some_func;
|
||||||
|
|
||||||
|
fn func() {
|
||||||
|
some_crate::some_func();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```rust
|
||||||
|
use some_crate::some_func;
|
||||||
|
|
||||||
|
#[rtic::app(/* .. */)]
|
||||||
|
mod app {
|
||||||
|
fn func() {
|
||||||
|
super::some_crate::some_func();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
## Move Dispatchers from `extern "C"` to app arguments.
|
## Move Dispatchers from `extern "C"` to app arguments.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue