diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62b6a75..3a25799 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,7 @@ jobs: continue-on-error: ${{ matrix.checks == 'advisories' }} steps: - uses: actions/checkout@v4 - - uses: EmbarkStudios/cargo-deny-action@v1 + - uses: EmbarkStudios/cargo-deny-action@v2 with: command: check ${{ matrix.checks }} diff --git a/deny.toml b/deny.toml index 76f591b..ebfc402 100644 --- a/deny.toml +++ b/deny.toml @@ -74,6 +74,7 @@ ignore = [ #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" }, #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, + { id = "RUSTSEC-2024-0384", reason = "unmaintained transient dependency, will be updated in next nod version" }, ] # If this is true, then cargo deny will use the git executable to fetch advisory database. # If this is false, then it uses a built-in git library. diff --git a/src/analysis/pass.rs b/src/analysis/pass.rs index 80ccdbd..6c53bfb 100644 --- a/src/analysis/pass.rs +++ b/src/analysis/pass.rs @@ -31,9 +31,8 @@ impl AnalysisPass for FindTRKInterruptVectorTable { Ok(ret) => ret, Err(_) => continue, }; - if data.starts_with(TRK_TABLE_HEADER.as_bytes()) - && data[TRK_TABLE_HEADER.as_bytes().len()] == 0 - { + let trk_table_bytes = TRK_TABLE_HEADER.as_bytes(); + if data.starts_with(trk_table_bytes) && data[trk_table_bytes.len()] == 0 { log::debug!("Found gTRKInterruptVectorTable @ {:#010X}", start); state.known_symbols.entry(start).or_default().push(ObjSymbol { name: "gTRKInterruptVectorTable".to_string(), diff --git a/src/util/config.rs b/src/util/config.rs index 0052770..2ee8d1a 100644 --- a/src/util/config.rs +++ b/src/util/config.rs @@ -787,7 +787,7 @@ pub mod signed_hex_serde { where D: Deserializer<'de> { struct SignedHexVisitor; - impl<'de> serde::de::Visitor<'de> for SignedHexVisitor { + impl serde::de::Visitor<'_> for SignedHexVisitor { type Value = i64; fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { @@ -860,7 +860,7 @@ impl<'de> serde::Deserialize<'de> for SectionAddressRef { where D: serde::Deserializer<'de> { struct SectionAddressRefVisitor; - impl<'de> serde::de::Visitor<'de> for SectionAddressRefVisitor { + impl serde::de::Visitor<'_> for SectionAddressRefVisitor { type Value = SectionAddressRef; fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/src/util/map.rs b/src/util/map.rs index c99afa3..6a889fe 100644 --- a/src/util/map.rs +++ b/src/util/map.rs @@ -802,10 +802,7 @@ pub fn apply_map(mut result: MapInfo, obj: &mut ObjInfo) -> Result<()> { } ObjSectionKind::Data | ObjSectionKind::ReadOnlyData => { if section.elf_index == 4 { - if result - .section_symbols - .get(".rodata") - .map_or(false, |m| !m.is_empty()) + if result.section_symbols.get(".rodata").is_some_and(|m| !m.is_empty()) { ".rodata" } else { diff --git a/src/util/mod.rs b/src/util/mod.rs index b81fc92..cec5da5 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -94,7 +94,7 @@ pub enum Bytes<'a> { Owned(Box<[u8]>), } -impl<'a> Bytes<'a> { +impl Bytes<'_> { pub fn into_owned(self) -> Box<[u8]> { match self { Bytes::Borrowed(s) => Box::from(s), @@ -103,7 +103,7 @@ impl<'a> Bytes<'a> { } } -impl<'a> AsRef<[u8]> for Bytes<'a> { +impl AsRef<[u8]> for Bytes<'_> { fn as_ref(&self) -> &[u8] { match self { Bytes::Borrowed(s) => s, diff --git a/src/util/u8_arc.rs b/src/util/u8_arc.rs index 8fc3a50..04f1b7d 100644 --- a/src/util/u8_arc.rs +++ b/src/util/u8_arc.rs @@ -149,7 +149,7 @@ impl<'a> U8View<'a> { let mut idx = 1; let mut stop_at = None; while let Some(node) = self.nodes.get(idx).copied() { - if self.get_name(node).map_or(false, |name| name.eq_ignore_ascii_case(current)) { + if self.get_name(node).is_ok_and(|name| name.eq_ignore_ascii_case(current)) { current = next_non_empty(&mut split); if current.is_empty() { return Some((idx, node));