heapless
heapless copied to clipboard
Add `uDisplay` for `String` and inline `ufmt` functions
Most likely the compiler already inlines the function calls, but afaik adding the annotation makes it more likely.
I could not build it locally due to:
Compiling heapless v0.8.0 (/home/lucas/repos/heapless)
error[E0658]: use of unstable library feature 'build_hasher_simple_hash_one'
--> src/indexmap.rs:1260:28
|
1260 | HashValue(build_hasher.hash_one(key) as u16)
| ^^^^^^^^
|
= note: see issue #86161 <https://github.com/rust-lang/rust/issues/86161> for more information
For more information about this error, try `rustc --explain E0658`.
error: could not compile `heapless` due to previous error
But the implementation seems trivial and has been tested elsewhere.
I did not add uDisplay for Vec because the formatting is not trivial.
We might want to consider adding uDebug, but don't know what the rusty way to do so would be.
We might want to consider adding
uDebug, but don't know what the rusty way to do so would be.
Does ufmt not already provide an implementation for str?
Apparently not yet: https://github.com/japaric/ufmt/issues/52
inline(always) is almost never needed, so let's use only inline.
can you rebase and fix CI?
can you rebase and fix CI?
Done, also changed #[inline(always)] to #[inline]