summaryrefslogtreecommitdiff
path: root/runtime/ops/os/mod.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-01-27 10:43:16 -0500
committerGitHub <noreply@github.com>2023-01-27 10:43:16 -0500
commitf5840bdcd360ec0bac2501f333e58e25742b1537 (patch)
tree7eb0818d2cafa0f6824e81b6ed2cfb609830971e /runtime/ops/os/mod.rs
parent1a1faff2f67613ed0b89e1a34e6c3fd02ca6fd83 (diff)
chore: upgrade to Rust 1.67 (#17548)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/ops/os/mod.rs')
-rw-r--r--runtime/ops/os/mod.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/runtime/ops/os/mod.rs b/runtime/ops/os/mod.rs
index c35d4fc9e..f970c318b 100644
--- a/runtime/ops/os/mod.rs
+++ b/runtime/ops/os/mod.rs
@@ -92,14 +92,12 @@ fn op_set_env(
}
if key.contains(&['=', '\0'] as &[char]) {
return Err(type_error(format!(
- "Key contains invalid characters: {:?}",
- key
+ "Key contains invalid characters: {key:?}"
)));
}
if value.contains('\0') {
return Err(type_error(format!(
- "Value contains invalid characters: {:?}",
- value
+ "Value contains invalid characters: {value:?}"
)));
}
env::set_var(key, value);
@@ -129,8 +127,7 @@ fn op_get_env(
if key.contains(&['=', '\0'] as &[char]) {
return Err(type_error(format!(
- "Key contains invalid characters: {:?}",
- key
+ "Key contains invalid characters: {key:?}"
)));
}
@@ -215,7 +212,7 @@ impl From<netif::Interface> for NetworkInterface {
};
let (address, range) = ifa.cidr();
- let cidr = format!("{:?}/{}", address, range);
+ let cidr = format!("{address:?}/{range}");
let name = ifa.name().to_owned();
let address = format!("{:?}", ifa.address());
@@ -223,10 +220,7 @@ impl From<netif::Interface> for NetworkInterface {
let scopeid = ifa.scope_id();
let [b0, b1, b2, b3, b4, b5] = ifa.mac();
- let mac = format!(
- "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}",
- b0, b1, b2, b3, b4, b5
- );
+ let mac = format!("{b0:02x}:{b1:02x}:{b2:02x}:{b3:02x}:{b4:02x}:{b5:02x}");
Self {
family,