A Rust utility crate that provides enhanced display formatting for various types.
display-more
is a helper library that extends the standard Display
trait functionality in Rust, providing more flexible and customizable display formatting for common types such as:
Option<T>
values- Slices
- Unix epoch timestamps
- Display Option: Enhanced formatting for
Option<T>
values - Display Slice: Customizable display formatting for slice types
- Display Unix Epoch: Human-readable formatting for Unix timestamp values
Add the following to your Cargo.toml
:
[dependencies]
display-more = "0.1.0"
use display_more::DisplayOption;
let value: Option<i32> = Some(42);
println!("Value: {}", value.display());
use display_more::DisplaySlice;
let numbers = [1, 2, 3, 4, 5];
println!("Numbers: {}", numbers.display());
use display_more::DisplayUnixEpoch;
let timestamp = 1671234567;
println!("Time: {}", timestamp.display());
This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.