Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
liebman authored and burrbull committed May 20, 2023
1 parent 6ad6dc4 commit bf26619
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/generate/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,7 @@ pub fn render_register_mod(
Some(a) => a,
None => access,
};
let bit_or_bits = if f.bit_width() > 1 {
"bits"
} else {
"bit"
};
let bit_or_bits = if f.bit_width() > 1 { "bits" } else { "bit" };
let bit_or_bits = syn::Ident::new(&bit_or_bits, span);
log::debug!("register={} field={}", reg_name, f.name);
if field_access.can_read() && f.read_action.is_none() {
Expand All @@ -280,7 +276,7 @@ pub fn render_register_mod(
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()))
});
});
}
} else {
let f_name = util::replace_suffix(&f.name, "");
Expand Down Expand Up @@ -322,7 +318,7 @@ pub fn render_register_mod(
mod_items.extend(quote! {
impl R #open #r_impl_items #close
});
mod_items.extend(quote!{
mod_items.extend(quote! {
#r_debug_impl
});
}
Expand Down

0 comments on commit bf26619

Please sign in to comment.