diff --git a/edgelet/Cargo.lock b/edgelet/Cargo.lock index 96a8384a468..03ba914768f 100644 --- a/edgelet/Cargo.lock +++ b/edgelet/Cargo.lock @@ -78,7 +78,7 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "aziot-cert-client-async" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-cert-common-http", "aziot-key-common", @@ -91,7 +91,7 @@ dependencies = [ [[package]] name = "aziot-cert-common-http" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-key-common", "serde", @@ -100,8 +100,9 @@ dependencies = [ [[package]] name = "aziot-certd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ + "cert-renewal", "hex 0.4.3", "http-common", "libc", @@ -140,7 +141,7 @@ dependencies = [ [[package]] name = "aziot-identity-client-async" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-cert-common-http", "aziot-identity-common", @@ -154,7 +155,7 @@ dependencies = [ [[package]] name = "aziot-identity-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-key-common", "http-common", @@ -164,7 +165,7 @@ dependencies = [ [[package]] name = "aziot-identity-common-http" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-cert-common-http", "aziot-identity-common", @@ -178,9 +179,10 @@ dependencies = [ [[package]] name = "aziot-identityd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-identity-common", + "cert-renewal", "http-common", "libc", "serde", @@ -190,7 +192,7 @@ dependencies = [ [[package]] name = "aziot-key-client" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-key-common", "aziot-key-common-http", @@ -205,7 +207,7 @@ dependencies = [ [[package]] name = "aziot-key-client-async" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-key-common", "aziot-key-common-http", @@ -218,7 +220,7 @@ dependencies = [ [[package]] name = "aziot-key-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "serde", ] @@ -226,7 +228,7 @@ dependencies = [ [[package]] name = "aziot-key-common-http" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-key-common", "http-common", @@ -236,7 +238,7 @@ dependencies = [ [[package]] name = "aziot-key-openssl-engine" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-key-client", "aziot-key-common", @@ -254,7 +256,7 @@ dependencies = [ [[package]] name = "aziot-keyd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "http-common", "libc", @@ -264,7 +266,7 @@ dependencies = [ [[package]] name = "aziot-keys-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "pkcs11", "serde", @@ -274,7 +276,7 @@ dependencies = [ [[package]] name = "aziot-tpmd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "http-common", "serde", @@ -283,7 +285,7 @@ dependencies = [ [[package]] name = "aziotctl-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "anyhow", "aziot-certd-config", @@ -292,6 +294,7 @@ dependencies = [ "aziot-keys-common", "aziot-tpmd-config", "base64 0.13.0", + "cert-renewal", "http-common", "log", "nix", @@ -411,6 +414,15 @@ version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" +[[package]] +name = "cert-renewal" +version = "0.1.0" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" +dependencies = [ + "openssl", + "serde", +] + [[package]] name = "cfg-if" version = "0.1.10" @@ -475,7 +487,7 @@ dependencies = [ [[package]] name = "config-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "serde", "toml", @@ -1142,7 +1154,7 @@ dependencies = [ [[package]] name = "http-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "async-trait", "base64 0.13.0", @@ -1421,7 +1433,7 @@ dependencies = [ [[package]] name = "logger" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "env_logger", "log", @@ -1592,7 +1604,7 @@ dependencies = [ [[package]] name = "openssl-build" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "cc", ] @@ -1623,7 +1635,7 @@ dependencies = [ [[package]] name = "openssl-sys2" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "openssl-build", "openssl-sys", @@ -1632,7 +1644,7 @@ dependencies = [ [[package]] name = "openssl2" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "foreign-types", "foreign-types-shared", @@ -1694,7 +1706,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs11" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "foreign-types-shared", "lazy_static", @@ -1711,7 +1723,7 @@ dependencies = [ [[package]] name = "pkcs11-sys" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" [[package]] name = "pkg-config" @@ -2172,7 +2184,7 @@ dependencies = [ [[package]] name = "test-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#5ebde5d8a9caf430392e0599f54ca0da0d774fdc" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#8f53f29c063c03529e508ee4111c7f1b1110c08f" dependencies = [ "aziot-identity-common", "aziot-identity-common-http", diff --git a/edgelet/edgelet-core/src/certificate_properties.rs b/edgelet/edgelet-core/src/certificate_properties.rs index 8ae6b468e72..8814b1bbb60 100644 --- a/edgelet/edgelet-core/src/certificate_properties.rs +++ b/edgelet/edgelet-core/src/certificate_properties.rs @@ -43,6 +43,7 @@ impl CertificateProperties { &self.common_name } + #[must_use] pub fn with_common_name(mut self, common_name: String) -> Self { self.common_name = common_name; self @@ -52,6 +53,7 @@ impl CertificateProperties { &self.certificate_type } + #[must_use] pub fn with_certificate_type(mut self, certificate_type: CertificateType) -> Self { self.certificate_type = certificate_type; self @@ -61,6 +63,7 @@ impl CertificateProperties { &self.alias } + #[must_use] pub fn with_alias(mut self, alias: String) -> Self { self.alias = alias; self @@ -70,6 +73,7 @@ impl CertificateProperties { &self.issuer } + #[must_use] pub fn with_issuer(mut self, issuer: CertificateIssuer) -> Self { self.issuer = issuer; self @@ -79,6 +83,7 @@ impl CertificateProperties { self.dns_san_entries.as_ref().map(AsRef::as_ref) } + #[must_use] pub fn with_dns_san_entries(mut self, entries: Vec) -> Self { self.dns_san_entries = Some(entries); self @@ -88,6 +93,7 @@ impl CertificateProperties { self.ip_entries.as_ref().map(AsRef::as_ref) } + #[must_use] pub fn with_ip_entries(mut self, entries: Vec) -> Self { self.ip_entries = Some(entries); self diff --git a/edgelet/edgelet-core/src/identity.rs b/edgelet/edgelet-core/src/identity.rs index 1a9a8027ba0..f7af9cb0d9e 100644 --- a/edgelet/edgelet-core/src/identity.rs +++ b/edgelet/edgelet-core/src/identity.rs @@ -52,6 +52,7 @@ impl IdentitySpec { self.generation_id.as_ref().map(AsRef::as_ref) } + #[must_use] pub fn with_generation_id(mut self, generation_id: String) -> Self { self.generation_id = Some(generation_id); self @@ -61,6 +62,7 @@ impl IdentitySpec { self.managed_by.as_ref().map(AsRef::as_ref) } + #[must_use] pub fn with_managed_by(mut self, managed_by: String) -> Self { self.managed_by = Some(managed_by); self diff --git a/edgelet/edgelet-core/src/module.rs b/edgelet/edgelet-core/src/module.rs index 78a30149c81..cc923678139 100644 --- a/edgelet/edgelet-core/src/module.rs +++ b/edgelet/edgelet-core/src/module.rs @@ -83,6 +83,7 @@ impl ModuleRuntimeState { &self.status } + #[must_use] pub fn with_status(mut self, status: ModuleStatus) -> Self { self.status = status; self @@ -92,6 +93,7 @@ impl ModuleRuntimeState { self.exit_code } + #[must_use] pub fn with_exit_code(mut self, exit_code: Option) -> Self { self.exit_code = exit_code; self @@ -101,6 +103,7 @@ impl ModuleRuntimeState { self.status_description.as_ref().map(AsRef::as_ref) } + #[must_use] pub fn with_status_description(mut self, status_description: Option) -> Self { self.status_description = status_description; self @@ -110,6 +113,7 @@ impl ModuleRuntimeState { self.started_at.as_ref() } + #[must_use] pub fn with_started_at(mut self, started_at: Option>) -> Self { self.started_at = started_at; self @@ -119,6 +123,7 @@ impl ModuleRuntimeState { self.finished_at.as_ref() } + #[must_use] pub fn with_finished_at(mut self, finished_at: Option>) -> Self { self.finished_at = finished_at; self @@ -128,6 +133,7 @@ impl ModuleRuntimeState { self.image_id.as_ref().map(AsRef::as_ref) } + #[must_use] pub fn with_image_id(mut self, image_id: Option) -> Self { self.image_id = image_id; self @@ -137,6 +143,7 @@ impl ModuleRuntimeState { self.pid } + #[must_use] pub fn with_pid(mut self, pid: Option) -> Self { self.pid = pid; self @@ -200,26 +207,31 @@ impl LogOptions { } } + #[must_use] pub fn with_follow(mut self, follow: bool) -> Self { self.follow = follow; self } + #[must_use] pub fn with_tail(mut self, tail: LogTail) -> Self { self.tail = tail; self } + #[must_use] pub fn with_since(mut self, since: i32) -> Self { self.since = since; self } + #[must_use] pub fn with_until(mut self, until: i32) -> Self { self.until = Some(until); self } + #[must_use] pub fn with_timestamps(mut self, timestamps: bool) -> Self { self.timestamps = timestamps; self diff --git a/edgelet/edgelet-docker/src/runtime.rs b/edgelet/edgelet-docker/src/runtime.rs index d9538b0eb42..9535e4c1dc3 100644 --- a/edgelet/edgelet-docker/src/runtime.rs +++ b/edgelet/edgelet-docker/src/runtime.rs @@ -427,10 +427,7 @@ impl ModuleRuntime for DockerModuleRuntime { let create_options = module.config().create_options().clone(); let merged_env = DockerModuleRuntime::merge_env(create_options.env(), module.env()); - let mut labels = create_options - .labels() - .cloned() - .unwrap_or_else(BTreeMap::new); + let mut labels = create_options.labels().cloned().unwrap_or_default(); labels.insert(OWNER_LABEL_KEY.to_string(), OWNER_LABEL_VALUE.to_string()); labels.insert( ORIGINAL_IMAGE_LABEL_KEY.to_string(), diff --git a/edgelet/edgelet-http-workload/src/module/cert/mod.rs b/edgelet/edgelet-http-workload/src/module/cert/mod.rs index cc6cedea7c7..47436b3e2ce 100644 --- a/edgelet/edgelet-http-workload/src/module/cert/mod.rs +++ b/edgelet/edgelet-http-workload/src/module/cert/mod.rs @@ -377,39 +377,33 @@ mod tests { let test_certs = vec![ // Expired certificate. ( - test_common::credential::test_certificate( - "testCertificate", - Some(|cert| { - let expired = openssl::asn1::Asn1Time::from_unix(1).unwrap(); - cert.set_not_after(&expired).unwrap(); - }), - ), + test_common::credential::custom_test_certificate("testCertificate", |cert| { + let expired = openssl::asn1::Asn1Time::from_unix(1).unwrap(); + cert.set_not_after(&expired).unwrap(); + }), true, ), // Certificate that is near expiry. ( - test_common::credential::test_certificate( - "testCertificate", - Some(|cert| { - let now = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .unwrap(); - - // Certs within 5 mins of expiration should renew, so set an expiration - // time 2 mins from now. - let expiry_time = now.as_secs() + 120; - let expiry_time: libc::time_t = - std::convert::TryInto::try_into(expiry_time).unwrap(); - - let expiry_time = openssl::asn1::Asn1Time::from_unix(expiry_time).unwrap(); - cert.set_not_after(&expiry_time).unwrap(); - }), - ), + test_common::credential::custom_test_certificate("testCertificate", |cert| { + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap(); + + // Certs within 5 mins of expiration should renew, so set an expiration + // time 2 mins from now. + let expiry_time = now.as_secs() + 120; + let expiry_time: libc::time_t = + std::convert::TryInto::try_into(expiry_time).unwrap(); + + let expiry_time = openssl::asn1::Asn1Time::from_unix(expiry_time).unwrap(); + cert.set_not_after(&expiry_time).unwrap(); + }), true, ), // Certificate that is not near expiry. ( - test_common::credential::test_certificate("testCertificate", None), + test_common::credential::test_certificate("testCertificate"), false, ), ]; diff --git a/edgelet/edgelet-settings/src/base/module.rs b/edgelet/edgelet-settings/src/base/module.rs index 392c877dd56..865dea0dfe2 100644 --- a/edgelet/edgelet-settings/src/base/module.rs +++ b/edgelet/edgelet-settings/src/base/module.rs @@ -59,6 +59,7 @@ impl Settings { &self.name } + #[must_use] pub fn with_name(mut self, name: String) -> Self { self.name = name; self @@ -68,6 +69,7 @@ impl Settings { &self.r#type } + #[must_use] pub fn with_type(mut self, r#type: String) -> Self { self.r#type = r#type; self @@ -77,6 +79,7 @@ impl Settings { self.image_pull_policy } + #[must_use] pub fn with_image_pull_policy(mut self, image_pull_policy: ImagePullPolicy) -> Self { self.image_pull_policy = image_pull_policy; self @@ -90,6 +93,7 @@ impl Settings { &mut self.config } + #[must_use] pub fn with_config(mut self, config: ModuleConfig) -> Self { self.config = config; self @@ -107,6 +111,7 @@ impl Settings { &mut self.env } + #[must_use] pub fn with_env(mut self, env: std::collections::BTreeMap) -> Self { self.env = env; self diff --git a/edgelet/edgelet-settings/src/docker/config.rs b/edgelet/edgelet-settings/src/docker/config.rs index a10d22ef9b1..a1830be57e8 100644 --- a/edgelet/edgelet-settings/src/docker/config.rs +++ b/edgelet/edgelet-settings/src/docker/config.rs @@ -51,6 +51,7 @@ impl DockerConfig { &self.image } + #[must_use] pub fn with_image(mut self, image: String) -> Self { self.image = image; self @@ -60,6 +61,7 @@ impl DockerConfig { self.image_hash.as_deref() } + #[must_use] pub fn with_image_hash(mut self, image_id: String) -> Self { self.image_hash = Some(image_id); self @@ -73,6 +75,7 @@ impl DockerConfig { &mut self.create_options } + #[must_use] pub fn with_create_options( mut self, create_options: docker::models::ContainerCreateBody, @@ -93,6 +96,7 @@ impl DockerConfig { self.auth.as_ref() } + #[must_use] pub fn with_auth(mut self, auth: docker::models::AuthConfig) -> Self { self.auth = Some(auth); self diff --git a/edgelet/edgelet-settings/src/docker/init.rs b/edgelet/edgelet-settings/src/docker/init.rs index 4df1e861c1b..b19de4bb29a 100644 --- a/edgelet/edgelet-settings/src/docker/init.rs +++ b/edgelet/edgelet-settings/src/docker/init.rs @@ -97,7 +97,7 @@ fn agent_networking(settings: &mut crate::docker::Settings) { let mut endpoints_config = network_config .endpoints_config() .cloned() - .unwrap_or_else(std::collections::BTreeMap::new); + .unwrap_or_default(); if !endpoints_config.contains_key(network_id.as_str()) { endpoints_config.insert(network_id, docker::models::EndpointSettings::new()); @@ -114,10 +114,7 @@ fn agent_networking(settings: &mut crate::docker::Settings) { fn agent_labels(settings: &mut crate::docker::Settings) { let create_options = settings.agent().config().create_options().clone(); - let mut labels = create_options - .labels() - .cloned() - .unwrap_or_else(std::collections::BTreeMap::new); + let mut labels = create_options.labels().cloned().unwrap_or_default(); // IoT Edge reserves the label prefix "net.azure-devices.edge" for its own purposes // so we'll simply overwrite any matching labels created by the user. diff --git a/edgelet/edgelet-settings/src/docker/mod.rs b/edgelet/edgelet-settings/src/docker/mod.rs index d36f33e3904..ee3a455ca97 100644 --- a/edgelet/edgelet-settings/src/docker/mod.rs +++ b/edgelet/edgelet-settings/src/docker/mod.rs @@ -42,6 +42,7 @@ impl Settings { &self.moby_runtime } + #[must_use] pub fn agent_upstream_resolve(mut self, parent_hostname: &str) -> Self { crate::RuntimeSettings::agent_mut(&mut self) .config_mut() diff --git a/edgelet/edgelet-settings/src/docker/network.rs b/edgelet/edgelet-settings/src/docker/network.rs index 1ad8432d676..2e41f52d1a3 100644 --- a/edgelet/edgelet-settings/src/docker/network.rs +++ b/edgelet/edgelet-settings/src/docker/network.rs @@ -46,6 +46,7 @@ impl Network { &self.name } + #[must_use] pub fn with_name(mut self, name: String) -> Self { self.name = name; self @@ -55,6 +56,7 @@ impl Network { self.ipv6 } + #[must_use] pub fn with_ipv6(mut self, ipv6: Option) -> Self { self.ipv6 = ipv6; self @@ -64,6 +66,7 @@ impl Network { self.ipam.as_ref() } + #[must_use] pub fn with_ipam(mut self, ipam: Ipam) -> Self { self.ipam = Some(ipam); self @@ -81,6 +84,7 @@ impl Ipam { self.config.as_deref() } + #[must_use] pub fn with_config(mut self, config: Vec) -> Self { self.config = Some(config); self @@ -104,6 +108,7 @@ impl IpamConfig { self.gateway.as_deref() } + #[must_use] pub fn with_gateway(mut self, gateway: String) -> Self { self.gateway = Some(gateway); self @@ -113,6 +118,7 @@ impl IpamConfig { self.subnet.as_deref() } + #[must_use] pub fn with_subnet(mut self, subnet: String) -> Self { self.subnet = Some(subnet); self @@ -122,6 +128,7 @@ impl IpamConfig { self.ip_range.as_deref() } + #[must_use] pub fn with_ip_range(mut self, ip_range: String) -> Self { self.ip_range = Some(ip_range); self diff --git a/edgelet/iotedge/src/config/super_config.rs b/edgelet/iotedge/src/config/super_config.rs index 774c2eea1fd..33bf9c55608 100644 --- a/edgelet/iotedge/src/config/super_config.rs +++ b/edgelet/iotedge/src/config/super_config.rs @@ -77,7 +77,7 @@ pub fn default_agent() -> edgelet_settings::ModuleSpec, }, Preloaded { cert: Url, diff --git a/edgelet/iotedge/src/main.rs b/edgelet/iotedge/src/main.rs index d8ad357edaa..128c8e3ddae 100644 --- a/edgelet/iotedge/src/main.rs +++ b/edgelet/iotedge/src/main.rs @@ -47,7 +47,7 @@ async fn run() -> Result<(), Error> { let default_diagnostics_image_name = format!( "/azureiotedge-diagnostics:{}", - edgelet_core::version().replace("~", "-") + edgelet_core::version().replace('~', "-") ); let default_support_bundle_name = format!( diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 233def5f74a..10642737023 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.58" +channel = "1.59"