Skip to content

Support no_std targets in Rust library#22

Merged
sdmueller merged 1 commit intoSensirion:masterfrom
rblaze:master
Jan 22, 2026
Merged

Support no_std targets in Rust library#22
sdmueller merged 1 commit intoSensirion:masterfrom
rblaze:master

Conversation

@rblaze
Copy link
Contributor

@rblaze rblaze commented Jan 20, 2026

Some embedded targets are no_std and lack math functions for f32. This pull request adds support for these targets by using the libm implementation of the functions.

Tested on target = "thumbv6m-none-eabi"

@sdmueller
Copy link
Contributor

Hi @rblaze

Thanks for your contribution!

Just one question as I am not that well versed in the Rust ecosystem, what is the motivation to remove/ignore the Cargo.lock?

@rblaze
Copy link
Contributor Author

rblaze commented Jan 20, 2026

This probably should be a separate pull request, let me split it away later today.

The lock file doesn't make much sense for libraries: library consumers will ignore it anyway. The only thing that will use Cargo.lock is library's own tests. Having it checked in lessens the support burden if you have autotests in CI pipeline, but pushes the "build fails with the latest dependencies" events to the consumer. Matter of choice, up to you how you want this to go.

Some details are available in https://doc.rust-lang.org/cargo/faq.html#why-have-cargolock-in-version-control and rust-lang/cargo#315

@rblaze
Copy link
Contributor Author

rblaze commented Jan 21, 2026

Removed Cargo.lock from gitignore. The file still changed because of the new dependencies.

@sdmueller sdmueller merged commit fce100a into Sensirion:master Jan 22, 2026
14 of 16 checks passed
@sdmueller
Copy link
Contributor

Thanks a lot for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants