Skip to content

Commit 15a1812

Browse files
committed
clippy
1 parent edad527 commit 15a1812

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl IdentFormat {
192192
self
193193
}
194194
pub fn parse(s: &str) -> Result<Self, IdentFormatError> {
195-
let mut f = s.split(":");
195+
let mut f = s.split(':');
196196
match (f.next(), f.next(), f.next()) {
197197
(Some(p), Some(c), Some(s)) => {
198198
let case = Case::parse(c)?;

src/generate/register.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl<'a> EV<'a> {
527527
impl<'a> From<&'a (EnumeratedValues, Option<EnumPath>)> for EV<'a> {
528528
fn from(value: &'a (EnumeratedValues, Option<EnumPath>)) -> Self {
529529
match value.1.as_ref() {
530-
Some(base) => Self::Derived(&value.0, &base),
530+
Some(base) => Self::Derived(&value.0, base),
531531
None => Self::New(&value.0),
532532
}
533533
}
@@ -1148,16 +1148,16 @@ pub fn fields(
11481148
} else if let Some(EV::Derived(_, base)) = rwenum.write_enum() {
11491149
// If field is in the same register it emits pub use structure from same module.
11501150
if base.register() != fpath.register() {
1151-
if rwenum.generate_write_enum() {
1152-
// use the same enum structure name
1153-
if !writer_enum_derives.contains(&value_write_ty) {
1154-
let base_path = base_syn_path(base, &fpath, &value_write_ty, config)?;
1155-
mod_items.extend(quote! {
1156-
#[doc = #description]
1157-
pub use #base_path as #value_write_ty;
1158-
});
1159-
writer_enum_derives.insert(value_write_ty.clone());
1160-
}
1151+
// use the same enum structure name
1152+
if rwenum.generate_write_enum()
1153+
&& !writer_enum_derives.contains(&value_write_ty)
1154+
{
1155+
let base_path = base_syn_path(base, &fpath, &value_write_ty, config)?;
1156+
mod_items.extend(quote! {
1157+
#[doc = #description]
1158+
pub use #base_path as #value_write_ty;
1159+
});
1160+
writer_enum_derives.insert(value_write_ty.clone());
11611161
}
11621162
}
11631163
}

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,23 +342,23 @@ Ignore this option if you are not building your own FPGA based soft-cores."),
342342
let mut features = Vec::new();
343343
if config.feature_group {
344344
features.extend(
345-
util::group_names(&device, &feature_format)
345+
util::group_names(&device, feature_format)
346346
.iter()
347347
.map(|s| format!("{s} = []\n")),
348348
);
349-
let add_groups: Vec<_> = util::group_names(&device, &feature_format)
349+
let add_groups: Vec<_> = util::group_names(&device, feature_format)
350350
.iter()
351351
.map(|s| format!("\"{s}\""))
352352
.collect();
353353
features.push(format!("all-groups = [{}]\n", add_groups.join(",")))
354354
}
355355
if config.feature_peripheral {
356356
features.extend(
357-
util::peripheral_names(&device, &feature_format)
357+
util::peripheral_names(&device, feature_format)
358358
.iter()
359359
.map(|s| format!("{s} = []\n")),
360360
);
361-
let add_peripherals: Vec<_> = util::peripheral_names(&device, &feature_format)
361+
let add_peripherals: Vec<_> = util::peripheral_names(&device, feature_format)
362362
.iter()
363363
.map(|s| format!("\"{s}\""))
364364
.collect();

0 commit comments

Comments
 (0)