network-api: drop unnecessary string allocations

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2024-06-28 10:32:39 +02:00
parent 52cf0c05f5
commit a3c1d9d456

View File

@ -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"
);
}