Skip to content

Commit 46fe6f8

Browse files
committed
Fix double reference warnings
See rust-lang/rust#110955.
1 parent 3c0cde5 commit 46fe6f8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/dwarfdump.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use fallible_iterator::FallibleIterator;
55
use gimli::{Section, UnitHeader, UnitOffset, UnitSectionOffset, UnitType, UnwindSection};
66
use object::{Object, ObjectSection, ObjectSymbol};
77
use regex::bytes::Regex;
8-
use std::borrow::{Borrow, Cow};
8+
use std::borrow::Cow;
99
use std::cmp::min;
1010
use std::collections::HashMap;
1111
use std::env;
@@ -497,7 +497,7 @@ fn main() {
497497
process::exit(1);
498498
}
499499
};
500-
let mmap_ref = (*arena_mmap.alloc(mmap)).borrow();
500+
let mmap_ref = arena_mmap.alloc(mmap);
501501
match object::File::parse(&**mmap_ref) {
502502
Ok(file) => Some(file),
503503
Err(err) => {
@@ -566,7 +566,7 @@ fn empty_file_section<'input, 'arena, Endian: gimli::Endianity>(
566566
let reader = gimli::EndianSlice::new(&[], endian);
567567
let section = reader;
568568
let relocations = RelocationMap::default();
569-
let relocations = (*arena_relocations.alloc(relocations)).borrow();
569+
let relocations = arena_relocations.alloc(relocations);
570570
Relocate {
571571
relocations,
572572
section,
@@ -602,10 +602,10 @@ fn load_file_section<'input, 'arena, Endian: gimli::Endianity>(
602602
// Use a non-zero capacity so that `ReaderOffsetId`s are unique.
603603
None => Cow::Owned(Vec::with_capacity(1)),
604604
};
605-
let data_ref = (*arena_data.alloc(data)).borrow();
605+
let data_ref = arena_data.alloc(data);
606606
let reader = gimli::EndianSlice::new(data_ref, endian);
607607
let section = reader;
608-
let relocations = (*arena_relocations.alloc(relocations)).borrow();
608+
let relocations = arena_relocations.alloc(relocations);
609609
Ok(Relocate {
610610
relocations,
611611
section,

0 commit comments

Comments
 (0)