From 5773e516787a90df4ed014cd20eed0226a1f63cd Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Wed, 31 Mar 2021 09:19:29 +0200 Subject: [PATCH] Inline a few methods --- compiler/rustc_data_structures/src/memmap.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_data_structures/src/memmap.rs b/compiler/rustc_data_structures/src/memmap.rs index 0c24f227cc9fc..29e999efeb18d 100644 --- a/compiler/rustc_data_structures/src/memmap.rs +++ b/compiler/rustc_data_structures/src/memmap.rs @@ -13,6 +13,7 @@ pub struct Mmap(Vec); #[cfg(not(target_arch = "wasm32"))] impl Mmap { + #[inline] pub unsafe fn map(file: File) -> io::Result { memmap2::Mmap::map(&file).map(Mmap) } @@ -20,6 +21,7 @@ impl Mmap { #[cfg(target_arch = "wasm32")] impl Mmap { + #[inline] pub unsafe fn map(mut file: File) -> io::Result { use std::io::Read; @@ -32,6 +34,7 @@ impl Mmap { impl Deref for Mmap { type Target = [u8]; + #[inline] fn deref(&self) -> &[u8] { &*self.0 }