Skip to content

Commit 27ff761

Browse files
cigraingerclaude
andcommitted
Fix clippy lints: dead_code, map_identity, manual_find
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 53cf3da commit 27ff761

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

native/simdxml_nif/src/document.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl rustler::Resource for DocumentResource {}
4242
pub fn parse(binary: Binary) -> Result<ResourceArc<DocumentResource>, String> {
4343
let bytes = binary.as_slice().to_vec();
4444
let inner = DocumentInner::try_new(bytes, |data| {
45-
let mut index = simdxml::parse(data).map_err(|e| e)?;
45+
let mut index = simdxml::parse(data)?;
4646
// Build all indices eagerly so the index can be used immutably.
4747
index.ensure_indices();
4848
index.build_name_index();
@@ -76,15 +76,11 @@ pub fn parse_for_xpath(
7676
#[rustler::nif]
7777
pub fn document_root(doc: ResourceArc<DocumentResource>) -> Option<usize> {
7878
let index = doc.index();
79-
for i in 0..index.tag_count() {
80-
if index.depth(i) == 0
79+
(0..index.tag_count()).find(|&i| {
80+
index.depth(i) == 0
8181
&& (index.tag_type(i) == simdxml::index::TagType::Open
8282
|| index.tag_type(i) == simdxml::index::TagType::SelfClose)
83-
{
84-
return Some(i);
85-
}
86-
}
87-
None
83+
})
8884
}
8985

9086
#[rustler::nif]

native/simdxml_nif/src/quick.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use rustler::{Binary, ResourceArc};
66
pub struct QuickScannerResource {
77
open_pattern: Vec<u8>,
88
close_pattern: Vec<u8>,
9+
#[allow(dead_code)]
910
tag: String,
1011
}
1112

0 commit comments

Comments
 (0)