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 eee3ea9 commit ff028e1Copy full SHA for ff028e1
os/src/fs/inode.rs
@@ -40,7 +40,8 @@ impl OSInode {
40
/// read all data from the inode
41
pub fn read_all(&self) -> Vec<u8> {
42
let mut inner = self.inner.exclusive_access();
43
- let mut buffer = [0u8; 512];
+ let mut buffer: Vec<u8> = Vec::with_capacity(512);
44
+ buffer.resize(512, 0);
45
let mut v: Vec<u8> = Vec::new();
46
loop {
47
let len = inner.inode.read_at(inner.offset, &mut buffer);
0 commit comments