Skip to content

Commit

Permalink
Fix build on Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
penberg committed Jan 13, 2024
1 parent 53e4e61 commit 24af042
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/io/darwin.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::Completion;
use anyhow::{Ok, Result};
use std::sync::Arc;
use std::cell::RefCell;
use std::io::{Read, Seek};

Expand Down Expand Up @@ -30,11 +31,12 @@ impl File {
pub fn pread(&self, pos: usize, c: Arc<Completion>) -> Result<()> {
let mut file = self.file.borrow_mut();
file.seek(std::io::SeekFrom::Start(pos as u64))?;
let buf = c.buf();
let mut buf = buf.as_mut_slice();
file.read_exact(buf)?;
drop(buf);
{
let mut buf = c.buf_mut();
let buf = buf.as_mut_slice();
file.read_exact(buf)?;
}
c.complete();
Ok(())
}
}
}

0 comments on commit 24af042

Please sign in to comment.