mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-29 21:40:27 +00:00
Add inline
annotations to wrapping function calls in ufmt
This should make the compiler inline the function calls to increase performance.
This commit is contained in:
parent
b21563dfa7
commit
d51cc11618
@ -111,6 +111,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- `ufmt-impl` is now `ufmt`
|
||||
- `cas` is removed, atomic polyfilling is now opt-in via the `portable-atomic` feature.
|
||||
- `Vec::as_mut_slice` is now a public method.
|
||||
- `ufmt` functions are annotated with `inline`.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
@ -7,6 +7,7 @@ use ufmt::uDisplay;
|
||||
use ufmt_write::uWrite;
|
||||
|
||||
impl<S: StringStorage + ?Sized> uDisplay for StringInner<S> {
|
||||
#[inline]
|
||||
fn fmt<W>(&self, f: &mut ufmt::Formatter<'_, W>) -> Result<(), W::Error>
|
||||
where
|
||||
W: uWrite + ?Sized,
|
||||
@ -17,6 +18,7 @@ impl<S: StringStorage + ?Sized> uDisplay for StringInner<S> {
|
||||
|
||||
impl<S: StringStorage + ?Sized> uWrite for StringInner<S> {
|
||||
type Error = CapacityError;
|
||||
#[inline]
|
||||
fn write_str(&mut self, s: &str) -> Result<(), Self::Error> {
|
||||
self.push_str(s)
|
||||
}
|
||||
@ -24,6 +26,7 @@ impl<S: StringStorage + ?Sized> uWrite for StringInner<S> {
|
||||
|
||||
impl<S: VecStorage<u8> + ?Sized> uWrite for VecInner<u8, S> {
|
||||
type Error = CapacityError;
|
||||
#[inline]
|
||||
fn write_str(&mut self, s: &str) -> Result<(), Self::Error> {
|
||||
self.extend_from_slice(s.as_bytes())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user