From f8fad1804f1070b2dc418341160d3ab9873fe000 Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Fri, 15 May 2020 10:40:37 -0400 Subject: [PATCH] Updated file string to avoid creating strings twice in test. --- risc_v/src/test.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/risc_v/src/test.rs b/risc_v/src/test.rs index 64f78ce..b122bb7 100644 --- a/risc_v/src/test.rs +++ b/risc_v/src/test.rs @@ -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();