Skip to content

Commit 9ac509d

Browse files
committed
ondisk: rename from_bytes_b to from_slice.
1 parent 4e23950 commit 9ac509d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/efs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<
5151
[0xff; ERASABLE_BLOCK_SIZE];
5252
let buf = &mut buf[.. size_of::<Item>()];
5353
self.storage.read_exact(self.current, buf).ok()?;
54-
let result = Item::from_bytes_b(buf)?; // TODO: Check for errors.
54+
let result = Item::from_slice(buf)?; // TODO: Check for errors.
5555
self.current = self
5656
.current
5757
.checked_add(size_of::<Item>() as u32)?;

src/ondisk.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,11 +916,11 @@ pub trait DirectoryEntry {
916916
fn set_size(&mut self, value: Option<u32>);
917917
}
918918
pub trait DirectoryEntrySerde: Sized {
919-
fn from_bytes_b(source: &[u8]) -> Option<Self>;
919+
fn from_slice(source: &[u8]) -> Option<Self>;
920920
fn copy_into_slice(&self, destination: &mut [u8]);
921921
}
922922
impl DirectoryEntrySerde for PspDirectoryEntry {
923-
fn from_bytes_b(source: &[u8]) -> Option<Self> {
923+
fn from_slice(source: &[u8]) -> Option<Self> {
924924
if source.len() != 16 {
925925
None
926926
} else {
@@ -1175,7 +1175,7 @@ make_bitfield_serde! {
11751175
}
11761176

11771177
impl DirectoryEntrySerde for BhdDirectoryEntry {
1178-
fn from_bytes_b(source: &[u8]) -> Option<Self> {
1178+
fn from_slice(source: &[u8]) -> Option<Self> {
11791179
if source.len() != 24 {
11801180
None
11811181
} else {
@@ -1413,7 +1413,7 @@ pub struct ComboDirectoryEntry {
14131413
}
14141414

14151415
impl DirectoryEntrySerde for ComboDirectoryEntry {
1416-
fn from_bytes_b(source: &[u8]) -> Option<Self> {
1416+
fn from_slice(source: &[u8]) -> Option<Self> {
14171417
if source.len() != 16 {
14181418
None
14191419
} else {

0 commit comments

Comments
 (0)