We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8331dbe commit 5773e51Copy full SHA for 5773e51
compiler/rustc_data_structures/src/memmap.rs
@@ -13,13 +13,15 @@ pub struct Mmap(Vec<u8>);
13
14
#[cfg(not(target_arch = "wasm32"))]
15
impl Mmap {
16
+ #[inline]
17
pub unsafe fn map(file: File) -> io::Result<Self> {
18
memmap2::Mmap::map(&file).map(Mmap)
19
}
20
21
22
#[cfg(target_arch = "wasm32")]
23
24
25
pub unsafe fn map(mut file: File) -> io::Result<Self> {
26
use std::io::Read;
27
@@ -32,6 +34,7 @@ impl Mmap {
32
34
impl Deref for Mmap {
33
35
type Target = [u8];
36
37
38
fn deref(&self) -> &[u8] {
39
&*self.0
40
0 commit comments