From 24bfdda3f90503691845e2b3a8a32ce99aa6df09 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Sat, 23 Mar 2019 18:21:57 +0800 Subject: [PATCH] Add panic message and use nightly toolchain --- rcore-fs-sfs/src/lib.rs | 4 ++-- rust-toolchain | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 rust-toolchain diff --git a/rcore-fs-sfs/src/lib.rs b/rcore-fs-sfs/src/lib.rs index b3986d9..b5dd1c1 100644 --- a/rcore-fs-sfs/src/lib.rs +++ b/rcore-fs-sfs/src/lib.rs @@ -28,14 +28,14 @@ trait DeviceExt: Device { debug_assert!(offset + buf.len() <= BLKSIZE); match self.read_at(id * BLKSIZE + offset, buf) { Some(len) if len == buf.len() => Ok(()), - _ => panic!(), + _ => panic!("cannot read block {} offset {} from device", id, offset), } } fn write_block(&self, id: BlockId, offset: usize, buf: &[u8]) -> vfs::Result<()> { debug_assert!(offset + buf.len() <= BLKSIZE); match self.write_at(id * BLKSIZE + offset, buf) { Some(len) if len == buf.len() => Ok(()), - _ => panic!(), + _ => panic!("cannot write block {} offset {} to device", id, offset), } } /// Load struct `T` from given block in device diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000..bf867e0 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +nightly