From ca054a618e69baa64c5ade8bd6d5bc1879c17921 Mon Sep 17 00:00:00 2001 From: Romulus21 Date: Sat, 5 Jun 2021 21:55:28 +0200 Subject: [PATCH] fix path --- src/device_var.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/device_var.rs b/src/device_var.rs index a34d993..d1e5ff1 100644 --- a/src/device_var.rs +++ b/src/device_var.rs @@ -9,11 +9,12 @@ pub fn read_env_var() { let mut path = env::var("PWD").unwrap().to_string(); path.push('/'); path.push_str(filename); + println!("{}", path); - fs::read_to_string(path) + fs::read_to_string(path.clone()) .expect("Something went wrong reading the file : device.env"); - if let Ok(lines) = read_lines(filename) { + if let Ok(lines) = read_lines(path) { for line in lines { if let Ok(var) = line { let new_var: Vec<&str> = var.split('=').collect(); @@ -33,4 +34,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +}