1
0
mirror of https://github.com/sgmarz/osblog.git synced 2024-11-23 18:06:20 +04:00

Updated file string to avoid creating strings twice in test.

This commit is contained in:
Stephen Marz 2020-05-15 10:40:37 -04:00
parent 5b5e5d9e2b
commit f8fad1804f

View File

@ -25,9 +25,10 @@ pub fn test_elf() {
// This won't be necessary after we connect this to the VFS, but for now, we need it.
const BDEV: usize = 8;
let mfs = MinixFileSystem::init(BDEV);
let desc = mfs.open(&String::from("/helloworld.elf")).ok();
let file_to_read = String::from("/helloworld.elf");
let desc = mfs.open(&file_to_read).ok();
if desc.is_none() {
println!("Error reading /helloworld.elf");
println!("Error reading {}", file_to_read);
return;
}
let ino = desc.unwrap();