Use explicitly-named args in impl_render_with_display ()

* Use explicitly-named args in `impl_render_with_display`

Implicitly-named args were failing on Rust 1.57 (but worked on Nightly).

* Fix macro formatting

Also add a TODO comment to revert later.

Co-authored-by: Chris Wong <lambda.fairy@gmail.com>
This commit is contained in:
Michael Alyn Miller 2022-01-12 21:00:31 -08:00 committed by GitHub
parent 6e3222f57a
commit 26cdad9991
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,7 +155,8 @@ macro_rules! impl_render_with_display {
$( $(
impl Render for $ty { impl Render for $ty {
fn render_to(&self, w: &mut String) { fn render_to(&self, w: &mut String) {
format_args!("{self}").render_to(w); // TODO: remove the explicit arg when Rust 1.58 is released
format_args!("{self}", self = self).render_to(w);
} }
} }
)* )*