agp 0.2.0

when {:?} fails you, use AGP
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented3 out of 3 items with examples
  • Size
  • Source code size: 41.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 261.02 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • IdkWhatAmIDoin

AGP

ever struggled with the pain of {:?} on hashmaps? sure, i guess {:#?} is a bit better, but all it does is just not make it a one-line blob.

well, Actual Good Printing has come to save you!

usage

use std::collections::HashMap;
use agp::ActualGoodPrinting;

fn main() {
    let mut map = HashMap::new();
    map.insert("status", "ok");
    map.insert("code", "200");

    map.agp();
    // output (order may vary):
    // status: ok
    // code: 200
}

to return it, do the same but swap .agp() for .return_agp():

use std::collections::HashMap;
use agp::ActualGoodPrinting;

fn main() {
    let mut map = HashMap::new();
    map.insert("status", "ok");
    map.insert("code", "200");

    let good_map = map.return_agp();
    println!("{good_map}");
}

installation

[dependencies]
agp = "0"