Skip to content

Commit

Permalink
Use explicitly-named args in impl_render_with_display (#328)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
malyn and lambda-fairy authored Jan 13, 2022
1 parent 6e3222f commit 26cdad9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion maud/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ macro_rules! impl_render_with_display {
$(
impl Render for $ty {
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);
}
}
)*
Expand Down

0 comments on commit 26cdad9

Please sign in to comment.