Skip to content

Commit a2740d2

Browse files
authored
Merge pull request #898 from robamu/more-clippy-fixes
more clippy fixes
2 parents c94dc77 + 40dc8ca commit a2740d2

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
1111
- Added lifetime ellision for `FieldWriter` where the explicit lifetimes are not necessary, which
1212
fixes the `clippy::needless_lifetimes` warning on rustc 1.84
1313
- Some fixes for the `svd2rust-regress` tool and update of its documentation
14+
- Other internal clippy fixes for `clippy::manual_div_ceil`, `clippy::nonminimal_bool` and
15+
`clippy::needless_lifetimes`
1416

1517
## [v0.35.0] - 2024-11-12
1618

ci/svd2rust-regress/src/github.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn find_executable(dir: &Path, begins: &str) -> Result<Option<PathBuf>, anyhow::
9393
.path()
9494
.extension()
9595
.is_some_and(|s| s == std::env::consts::EXE_EXTENSION))
96-
&& !entry.path().extension().is_some_and(|s| s == "gz")
96+
&& entry.path().extension().is_none_or(|s| s != "gz")
9797
{
9898
Ok(Some(entry.path()))
9999
} else {

src/generate/peripheral.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ impl FieldRegions {
411411
let mut indices = Vec::new();
412412

413413
let rbf_start = rbf.offset;
414-
let rbf_end = rbf_start + (rbf.size + BITS_PER_BYTE - 1) / BITS_PER_BYTE;
414+
let rbf_end = rbf_start + rbf.size.div_ceil(BITS_PER_BYTE);
415415

416416
// The region that we're going to insert
417417
let mut new_region = Region {

src/generate/register.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ pub enum EV<'a> {
519519
Derived(&'a EnumeratedValues, &'a EnumPath),
520520
}
521521

522-
impl<'a> EV<'a> {
522+
impl EV<'_> {
523523
fn values(&self) -> &EnumeratedValues {
524524
match self {
525525
Self::New(e) | Self::Derived(e, _) => e,

0 commit comments

Comments
 (0)