-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
defmt issue when crate name starts with number #30
Comments
Hi @jessetp, what error message are you getting? |
@Urhengulas |
Thank you. Can you please also share the whole example code? |
@Urhengulas , I've attached the zipped project, minus the target folder (for size limits). |
I am able to reproduce your issue by renaming $ # download and extract zip
$ cd co2-app/
$ cargo run --bin temperature_03
<this suceeds>
$ mv src/bin/temperature_03.rs src/bin/01_temperature_03.rs
$ cargo run --bin 01_temperature_03
error: `01_temperature_03` is not a valid identifier
--> src/bin/01_temperature_03.rs:32:5
|
32 | defmt::info!("{=f32} °C", temperature);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `defmt::info` (in Nightly builds, run with -Z macro-backtrace for more info) I am tried to run $ DEFMT_LOG=info cargo expand --bin 01_temperature_03
I also tried to run it with Will continue later. |
The error ...
|
I tried one approach to fixing this, which is just ignoring leading numbers: https://github.com/knurling-rs/defmt/tree/accept-crate-names-with-leading-numbers It works for |
defmt does not work when the crate name starts with a number (e.g.
01_hello_extended.rs
). I used the app template generator as suggested in the Knurling-session-20q4.Dependencies used in
Cargo.toml
:The text was updated successfully, but these errors were encountered: