| Crates.io | stackfmt |
| lib.rs | stackfmt |
| version | 0.1.2 |
| created_at | 2021-07-19 02:31:39.763453+00 |
| updated_at | 2021-11-12 04:18:39.104781+00 |
| description | Write formatted string to a buffer without alloc |
| homepage | |
| repository | https://github.com/vzvezda/stackfmt |
| max_upload_size | |
| id | 424563 |
| size | 10,008 |
Creates formatted string from format_args!() like alloc::fmt::format() but
without allocation:
let mut buf = [0u8; 64];
let formatted: &str = stackfmt::fmt_truncate(&mut buf, format_args!("Hello{}", 42));
assert_eq!(formatted, "Hello42");
Implemented based on this SO answer https://stackoverflow.com/a/50201632/601298