3 ms·
> I did eventually get around to using dyn Write, but that still gave me headaches because of how I cannot use impl Write as a result type in closures, I hope
by JoshTriplett 2y ago
> I did eventually get around to using dyn Write, but that still gave me headaches because of how I cannot use impl Write as a result type in closures,
I hope we manage to fix that! We're working on making `impl Trait` usable everywhere a type works. I'll check where "return type of a closure" is on the `impl Trait` radar.
https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/.60impl.20Trait.60.20in.20closure.20return.20types.3F https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lan...
> which I need to do if I want to use tracing_subscriber::fmt::with_writer() and pass in these trait objects.
Would https://docs.rs/tracing-subscriber/0.3.19/tracing_subscriber/fmt/writer/struct.BoxMakeWriter.html https://docs.rs/tracing-subscriber/0.3.19/tracing_subscriber... help you?
> Thank you so much for taking the time to write this. Means a lot!
Thank you as well for taking the time to fill in more details!
- hyperbrainer 2y agoWow, thank you so much for taking the time to do this. I love all of you guys in the rust community. > Would https://docs.rs/tracing-subscriber/0.3.19/tracing_subscriber https://docs.rs/tracing-subscriber/0.3.19/tracing_subscriber... help you? Indeed. This is brilliant.
- structural 2y agoI was just looking for something very similar, this is neat! I think even moreso I can understand the sense of Rust feeling too large not because the language itself is, but because there are SO many of these neat tricks and little utility functions that are necessary to express what you want, and it's quite impossible to remember each and every one and how to go back and find them later.