diff --git a/Cargo.lock b/Cargo.lock index c9f28ea..edeeb8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -926,7 +926,7 @@ dependencies = [ [[package]] name = "usdpl-back" -version = "0.5.0" +version = "0.5.2" dependencies = [ "bytes", "tokio", diff --git a/usdpl-back/Cargo.toml b/usdpl-back/Cargo.toml index 31cd5ae..95bedaf 100644 --- a/usdpl-back/Cargo.toml +++ b/usdpl-back/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "usdpl-back" -version = "0.5.1" +version = "0.5.3" edition = "2021" license = "GPL-3.0-only" repository = "https://github.com/NGnius/usdpl-rs" diff --git a/usdpl-back/src/api_common/files.rs b/usdpl-back/src/api_common/files.rs index 8193f47..b5cb1c5 100644 --- a/usdpl-back/src/api_common/files.rs +++ b/usdpl-back/src/api_common/files.rs @@ -15,7 +15,7 @@ pub fn write_single, D: Display>(path: P, display: D) -> Result<( /// Read something from a file. /// Useful for kernel configuration files. pub fn read_single, D: FromStr, E>(path: P) -> Result, Option)> { - let mut file = File::create(path).map_err(|e| (Some(e), None))?; + let mut file = File::open(path).map_err(|e| (Some(e), None))?; let mut string = String::new(); file.read_to_string(&mut string).map_err(|e| (Some(e), None))?; string.trim().parse().map_err(|e| (None, Some(e)))