[pve-devel] [PATCH 12/12] tui: remove unused read_json function

Aaron Lauterer a.lauterer at proxmox.com
Wed Oct 25 18:00:11 CEST 2023


Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 proxmox-tui-installer/src/setup.rs | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/proxmox-tui-installer/src/setup.rs b/proxmox-tui-installer/src/setup.rs
index 211a96b..efcabed 100644
--- a/proxmox-tui-installer/src/setup.rs
+++ b/proxmox-tui-installer/src/setup.rs
@@ -1,13 +1,10 @@
 use std::{
     collections::HashMap,
     fmt,
-    fs::File,
-    io::BufReader,
     net::IpAddr,
-    path::Path,
 };
 
-use serde::{Deserialize, Serialize, Serializer};
+use serde::{Serialize, Serializer};
 
 use crate::options::InstallerOptions;
 use proxmox_installer_common::{
@@ -129,13 +126,6 @@ impl From<InstallerOptions> for InstallConfig {
     }
 }
 
-pub fn read_json<T: for<'de> Deserialize<'de>, P: AsRef<Path>>(path: P) -> Result<T, String> {
-    let file = File::open(path).map_err(|err| err.to_string())?;
-    let reader = BufReader::new(file);
-
-    serde_json::from_reader(reader).map_err(|err| format!("failed to parse JSON: {err}"))
-}
-
 fn serialize_disk_opt<S>(value: &Option<Disk>, serializer: S) -> Result<S::Ok, S::Error>
 where
     S: Serializer,
-- 
2.39.2






More information about the pve-devel mailing list