write_fmt return number of bytes written #63614
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
rust-2-breakage-wishlist
In the wishlist of breaking changes that requires rust 2.0
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
The current
write_fmt
implementation has a return type ofResult<()>
is there any technical reason it couldn't return the number of bytes written? Similar to sprintf in C.An example use case in Smoltcp:
The return type of the closure requires indicates the number of bytes used such that smoltcp can flush those bytes to the wire.
The text was updated successfully, but these errors were encountered: