Skip to content

Commit e386656

Browse files
committed
Rustfmt
1 parent 91d01e7 commit e386656

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/librustc_codegen_llvm/metadata.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ impl MetadataLoader for LlvmMetadataLoader {
2222
// Use ArchiveRO for speed here, it's backed by LLVM and uses mmap
2323
// internally to read the file. We also avoid even using a memcpy by
2424
// just keeping the archive along while the metadata is in use.
25-
let archive = ArchiveRO::open(filename).map(|ar| OwningRef::new(Box::new(ar))).map_err(|e| {
26-
debug!("llvm didn't like `{}`: {}", filename.display(), e);
27-
format!("failed to read rlib metadata in '{}': {}", filename.display(), e)
28-
})?;
25+
let archive =
26+
ArchiveRO::open(filename).map(|ar| OwningRef::new(Box::new(ar))).map_err(|e| {
27+
debug!("llvm didn't like `{}`: {}", filename.display(), e);
28+
format!("failed to read rlib metadata in '{}': {}", filename.display(), e)
29+
})?;
2930
let buf: OwningRef<_, [u8]> = archive.try_map(|ar| {
3031
ar.iter()
3132
.filter_map(|s| s.ok())
@@ -44,9 +45,10 @@ impl MetadataLoader for LlvmMetadataLoader {
4445
let buf = path_to_c_string(filename);
4546
let mb = llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(buf.as_ptr())
4647
.ok_or_else(|| format!("error reading library: '{}'", filename.display()))?;
47-
let of = ObjectFile::new(mb).map(|of| OwningRef::new(Box::new(of))).ok_or_else(|| {
48-
format!("provided path not an object file: '{}'", filename.display())
49-
})?;
48+
let of =
49+
ObjectFile::new(mb).map(|of| OwningRef::new(Box::new(of))).ok_or_else(|| {
50+
format!("provided path not an object file: '{}'", filename.display())
51+
})?;
5052
let buf = of.try_map(|of| search_meta_section(of, target, filename))?;
5153
Ok(rustc_erase_owner!(buf))
5254
}

0 commit comments

Comments
 (0)