Skip to content

Commit e8e2393

Browse files
committed
Cargo Clippy
1 parent 7f107e9 commit e8e2393

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

crates/delink-macho/src/symtab_json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ fn sanitize_filename(name: &str) -> String {
369369
}
370370
})
371371
.collect();
372-
let trimmed = s.trim_start_matches(|c: char| c == '.' || c == '_');
372+
let trimmed = s.trim_start_matches(['.', '_']);
373373
let truncated = &trimmed[..trimmed.len().min(200)];
374374
if truncated.is_empty() {
375375
"unknown".to_string()

crates/delink-macho/src/symtab_split.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ pub fn build_cu_index_from_symtab(data: &[u8]) -> Result<MachoCuIndex> {
7979

8080
// Group into batches and build CUs.
8181
let mut units = Vec::new();
82-
let mut cu_id = 0usize;
83-
8482
for (batch_idx, batch) in fns.chunks(BATCH_SIZE).enumerate() {
8583
let batch_start = batch_idx * BATCH_SIZE;
8684
let functions: Vec<MachoFunction> = batch
@@ -104,15 +102,14 @@ pub fn build_cu_index_from_symtab(data: &[u8]) -> Result<MachoCuIndex> {
104102
let cu_name = functions[0].name.clone();
105103

106104
units.push(MachoCompilationUnit {
107-
id: cu_id,
105+
id: batch_idx,
108106
name: cu_name,
109107
comp_dir: None,
110108
oso_path: None,
111109
ranges,
112110
functions,
113111
variables: vec![],
114112
});
115-
cu_id += 1;
116113
}
117114

118115
Ok(MachoCuIndex { units })

0 commit comments

Comments
 (0)