Skip to content

Commit

Permalink
crates/sel4-async/block-io/cpiofs: Update for improvements in depende…
Browse files Browse the repository at this point in the history
…ncies

Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Oct 20, 2023
1 parent b940bee commit c1f0292
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/sel4-async/block-io/cpiofs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use core::mem;
use hex::FromHex;
use zerocopy::{AsBytes, FromBytes, FromZeroes};

use sel4_async_block_io::ByteIO;
use sel4_async_block_io::{access::ReadOnly, ByteIO};

const CPIO_ALIGN: usize = 4;

Expand Down Expand Up @@ -79,7 +79,7 @@ impl EntryLocation {
self.offset
}

async fn read_entry<T: ByteIO>(&self, io: &T) -> Result<Entry, T::Error> {
async fn read_entry<T: ByteIO<ReadOnly>>(&self, io: &T) -> Result<Entry, T::Error> {
let mut header = Header::new_zeroed();
io.read(self.offset().try_into().unwrap(), header.as_bytes_mut())
.await?;
Expand Down Expand Up @@ -133,7 +133,7 @@ impl Entry {
}
}

async fn read_name<T: ByteIO>(&self, io: &T) -> Result<String, T::Error> {
async fn read_name<T: ByteIO<ReadOnly>>(&self, io: &T) -> Result<String, T::Error> {
let mut buf = vec![0; self.header().name_size()];
io.read(self.name_offset().try_into().unwrap(), &mut buf)
.await?;
Expand All @@ -154,7 +154,7 @@ pub struct Index<T> {
io: T,
}

impl<T: ByteIO> Index<T> {
impl<T: ByteIO<ReadOnly>> Index<T> {
pub async fn create(io: T) -> Result<Self, T::Error> {
let mut entries = BTreeMap::new();
let mut location = EntryLocation::first();
Expand Down

0 comments on commit c1f0292

Please sign in to comment.