Stream: rustdoc

Topic: display_fn


view this post on Zulip Noah Lev (Jan 29 2021 at 02:10):

Why is display_fn needed? Is it a lifetimes issue?

view this post on Zulip Noah Lev (Jan 29 2021 at 02:13):

Ah, it seems like maybe it makes a closure that takes a Formatter...

view this post on Zulip Noah Lev (Jan 29 2021 at 02:21):

Specifically, it seems to wrap a closure that takes a Formatter such that it implements Display.

view this post on Zulip Dániel Buga (Jan 29 2021 at 07:17):

display_fn takes a closure and allows you to print/format in that closure without allocating a temporary string. At least it allows you to do this, but I'm not sure of it's original intent.


Last updated: Oct 21 2021 at 20:21 UTC