Skip to content

Latest commit

 

History

History
63 lines (40 loc) · 1.3 KB

README.md

File metadata and controls

63 lines (40 loc) · 1.3 KB

display-more

A Rust utility crate that provides enhanced display formatting for various types.

Overview

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

Features

  • 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

Usage

Add the following to your Cargo.toml:

[dependencies]
display-more = "0.1.0"

Examples

Display Option

use display_more::DisplayOption;

let value: Option<i32> = Some(42);
println!("Value: {}", value.display());

Display Slice

use display_more::DisplaySlice;

let numbers = [1, 2, 3, 4, 5];
println!("Numbers: {}", numbers.display());

Display Unix Epoch

use display_more::DisplayUnixEpoch;

let timestamp = 1671234567;
println!("Time: {}", timestamp.display());

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.