Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kangalio/display-utils
String formatting utilities that return impl Display and are 100% no_std compatible
https://github.com/kangalio/display-utils
Last synced: 9 days ago
JSON representation
String formatting utilities that return impl Display and are 100% no_std compatible
- Host: GitHub
- URL: https://github.com/kangalio/display-utils
- Owner: kangalio
- Created: 2021-01-09T13:40:51.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-13T10:27:22.000Z (over 3 years ago)
- Last Synced: 2024-10-21T01:37:45.797Z (17 days ago)
- Language: Rust
- Homepage:
- Size: 37.1 KB
- Stars: 39
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This no_std compatible library provides several useful constructs to format data in a human-readable
fashion with zero allocations.Why hand-roll annoying and verbose formatting code everywhere...
```rust
for i, item in list.iter().enumerate() {
if i == list.len() - 1 {
println!("{}", item);
} else {
print!("{} - ", item);
}
}
```
...when you could just use this?
```rust
println!("{}", display_utils::join(list, " - "));
```This library makes ingenious use of Rust's formatting abstractions to provide super flexible and
powerful formatting utilities, without any allocations.For more information, please see the documentation: https://docs.rs/display_utils