Skip to content

Commit 5773e51

Browse files
committed
Inline a few methods
1 parent 8331dbe commit 5773e51

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_data_structures/src/memmap.rs

+3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ pub struct Mmap(Vec<u8>);
1313

1414
#[cfg(not(target_arch = "wasm32"))]
1515
impl Mmap {
16+
#[inline]
1617
pub unsafe fn map(file: File) -> io::Result<Self> {
1718
memmap2::Mmap::map(&file).map(Mmap)
1819
}
1920
}
2021

2122
#[cfg(target_arch = "wasm32")]
2223
impl Mmap {
24+
#[inline]
2325
pub unsafe fn map(mut file: File) -> io::Result<Self> {
2426
use std::io::Read;
2527

@@ -32,6 +34,7 @@ impl Mmap {
3234
impl Deref for Mmap {
3335
type Target = [u8];
3436

37+
#[inline]
3538
fn deref(&self) -> &[u8] {
3639
&*self.0
3740
}

0 commit comments

Comments
 (0)