mre / prettyprint

Beautifully formatted output for your terminal 🌈
Apache License 2.0
200 stars 10 forks source link

PrettyPrint type is not public #2

Closed mitsuhiko closed 5 years ago

mitsuhiko commented 5 years ago

The generated PrettyPrint types is not public in the crate.

mre commented 5 years ago

Using it like so in cargo-inspect: https://github.com/mre/cargo-inspect/blob/master/src/lib.rs#L48-L50

Isn't that enough to work with the crate? I mean, we can expose the PrettyPrint struct, but I'm not sure what would be your use-case for it? πŸ€”

mre commented 5 years ago

Related: https://github.com/sharkdp/bat/issues/423

mitsuhiko commented 5 years ago

Because it’s missing in the docs but also linked in the docs from PrettyPrinter.

mitsuhiko commented 5 years ago

Eg: a 404 here and an unlinked type as a return value from build: https://docs.rs/prettyprint/0.2.0/prettyprint/struct.PrettyPrinter.html

mre commented 5 years ago

Good point. πŸ˜… That's auto-generated by derive-builder. We could add some custom documentation for the builder to fix that, I guess.

mitsuhiko commented 5 years ago

It also misses the docs then how to print. Is there a specific reason you don't want to just make the printer public? It's impossible to see from the docs how to use it.

mre commented 5 years ago

Apart from keeping the interface as small as possible to allow for internal refactoring without breaking usage, not really. Yeah, I think it's a good idea to make PrettyPrint public. Thanks for pointing that out. Would accept PRs for that. Otherwise I'll do it when I get to it.