From a3c1d9d4568826cbe1b57a4d75af3c5410374f43 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 28 Jun 2024 10:32:39 +0200 Subject: [PATCH] network-api: drop unnecessary string allocations Signed-off-by: Wolfgang Bumiller --- proxmox-network-api/src/config/mod.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/proxmox-network-api/src/config/mod.rs b/proxmox-network-api/src/config/mod.rs index 22bf9bbb..d9efeff9 100644 --- a/proxmox-network-api/src/config/mod.rs +++ b/proxmox-network-api/src/config/mod.rs @@ -604,11 +604,9 @@ mod tests { }; assert_eq!( String::try_from(nw_config).unwrap().trim(), - r#" + "\ iface enp3s0 inet static - address 10.0.0.100/16"# - .to_string() - .trim() + address 10.0.0.100/16" ); } @@ -628,12 +626,10 @@ iface enp3s0 inet static }; assert_eq!( String::try_from(nw_config).unwrap().trim(), - r#" + "\ iface enp3s0 inet static address 10.0.0.100/16 - gateway 10.0.0.1"# - .to_string() - .trim() + gateway 10.0.0.1" ); }