Skip to content

Commit

Permalink
Fix double reference warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tamird authored and imbillow committed Jun 3, 2024
1 parent 4f0493a commit 3b6a935
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/dwarfdump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use gimli::{
};
use object::{Object, ObjectSection, ObjectSymbol};
use regex::bytes::Regex;
use std::borrow::{Borrow, Cow};
use std::borrow::Cow;
use std::cmp::min;
use std::collections::HashMap;
use std::env;
Expand Down Expand Up @@ -501,7 +501,7 @@ fn main() {
process::exit(1);
}
};
let mmap_ref = (*arena_mmap.alloc(mmap)).borrow();
let mmap_ref = arena_mmap.alloc(mmap);
match object::File::parse(&**mmap_ref) {
Ok(file) => Some(file),
Err(err) => {
Expand Down Expand Up @@ -570,7 +570,7 @@ fn empty_file_section<'input, 'arena, Endian: gimli::Endianity>(
let reader = gimli::EndianSlice::new(&[], endian);
let section = reader;
let relocations = RelocationMap::default();
let relocations = (*arena_relocations.alloc(relocations)).borrow();
let relocations = arena_relocations.alloc(relocations);
Relocate {
relocations,
section,
Expand Down Expand Up @@ -606,10 +606,10 @@ fn load_file_section<'input, 'arena, Endian: gimli::Endianity>(
// Use a non-zero capacity so that `ReaderOffsetId`s are unique.
None => Cow::Owned(Vec::with_capacity(1)),
};
let data_ref = (*arena_data.alloc(data)).borrow();
let data_ref = arena_data.alloc(data);
let reader = gimli::EndianSlice::new(data_ref, endian);
let section = reader;
let relocations = (*arena_relocations.alloc(relocations)).borrow();
let relocations = arena_relocations.alloc(relocations);
Ok(Relocate {
relocations,
section,
Expand Down

0 comments on commit 3b6a935

Please sign in to comment.