| Crates.io | pretty-printer |
| lib.rs | pretty-printer |
| version | 0.1.1 |
| created_at | 2024-10-18 07:36:22.216684+00 |
| updated_at | 2024-10-18 07:49:31.693632+00 |
| description | A macro to simplify pretty-printing complex structures in Rust |
| homepage | |
| repository | https://github.com/bulpara/pretty-printer |
| max_upload_size | |
| id | 1413965 |
| size | 5,615 |
pretty-printer is a Rust library that provides a convenient macro for pretty-printing complex data structures using Rust's println!("{:#?}", x) functionality. Instead of manually writing println!("{:#?}", x) every time, you can use the pretty_print! macro to simplify your code.
To use pretty-printer in your project, add the following to your Cargo.toml file:
[dependencies]
pretty-printer = "0.1.0"
Then, run:
cargo build
After adding pretty-printer to your dependencies, you can use the pretty_print! macro to pretty-print your data structures in an easy-to-read format.
use pretty_printer::pretty_print;
fn main() {
let my_data = vec![1, 2, 3, 4];
pretty_print!(my_data);
}
This will output:
[
1,
2,
3,
4,
]
println!("{:#?}", x) every time.Contributions are welcome! Feel free to submit a pull request or open an issue to improve the library or add more features.
This project is licensed under the MIT License. See the LICENSE file for details.