Skip to content

Commit

Permalink
Merge pull request #836 from rust-embedded/fmt
Browse files Browse the repository at this point in the history
Debug impl cleanups
  • Loading branch information
Emilgardis authored May 6, 2024
2 parents ec223c9 + 305fcd7 commit aec3c4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- Remove unneeded `format_args` in register `Debug` impl

## [v0.33.1] - 2024-04-20

- Add checked `set` for not full safe fields
Expand Down
4 changes: 2 additions & 2 deletions src/generate/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,15 @@ fn render_register_mod_debug(
let f_name_n = field_accessor(&f.name.expand_dim(&suffix), config, span);
let f_name_n_s = format!("{f_name_n}");
r_debug_impl.extend(quote! {
.field(#f_name_n_s, &format_args!("{}", self.#f_name_n().#bit_or_bits()))
.field(#f_name_n_s, &self.#f_name_n().#bit_or_bits())
});
}
} else {
let f_name = f.name.remove_dim();
let f_name = field_accessor(&f_name, config, span);
let f_name_s = format!("{f_name}");
r_debug_impl.extend(quote! {
.field(#f_name_s, &format_args!("{}", self.#f_name().#bit_or_bits()))
.field(#f_name_s, &self.#f_name().#bit_or_bits())
});
}
}
Expand Down

0 comments on commit aec3c4f

Please sign in to comment.