diff --git a/conformance-tests/src/main.rs b/conformance-tests/src/main.rs index dbb02f36..cf37557f 100644 --- a/conformance-tests/src/main.rs +++ b/conformance-tests/src/main.rs @@ -162,7 +162,7 @@ impl SpinShim { ctr_run_id: &str, ) -> anyhow::Result { let port = get_available_port().context("no available port")?; - let listen_adress_env = format!("SPIN_HTTP_LISTEN_ADDR=0.0.0.0:{}", port); + let listen_adress_env = format!("SPIN_HTTP_LISTEN_ADDR=0.0.0.0:{port}"); let mut ctr_cmd = std::process::Command::new(ctr_binary_path); let child = ctr_cmd .arg("run") diff --git a/containerd-shim-spin/src/engine.rs b/containerd-shim-spin/src/engine.rs index 8bd140eb..37c0789d 100644 --- a/containerd-shim-spin/src/engine.rs +++ b/containerd-shim-spin/src/engine.rs @@ -99,11 +99,11 @@ impl Sandbox for SpinSandbox { Ok(0) } Ok(Err(err)) => { - log::error!("run_wasi ERROR >>> failed: {:?}", err); + log::error!("run_wasi ERROR >>> failed: {err:?}"); Err(err) } Err(aborted) => { - info!("Received signal to abort: {:?}", aborted); + info!("Received signal to abort: {aborted:?}"); Ok(0) } } diff --git a/containerd-shim-spin/src/source.rs b/containerd-shim-spin/src/source.rs index 49161928..d85d5e95 100644 --- a/containerd-shim-spin/src/source.rs +++ b/containerd-shim-spin/src/source.rs @@ -43,7 +43,7 @@ impl Source { if name == spin_oci::client::SPIN_APPLICATION_MEDIA_TYPE => { let path = PathBuf::from("/spin.json"); - log::info!("writing spin oci config to {:?}", path); + log::info!("writing spin oci config to {path:?}"); File::create(&path) .context("failed to create spin.json")? .write_all(&artifact.layer) diff --git a/containerd-shim-spin/src/trigger.rs b/containerd-shim-spin/src/trigger.rs index 536e5d65..067fb42b 100644 --- a/containerd-shim-spin/src/trigger.rs +++ b/containerd-shim-spin/src/trigger.rs @@ -38,7 +38,7 @@ where let builder: TriggerAppBuilder<_, FactorsBuilder> = TriggerAppBuilder::new(trigger); let builder_args = match std::env::var("SPIN_MAX_INSTANCE_MEMORY") { Ok(limit) => { - debug!("Setting instance max memory to {} bytes", limit); + debug!("Setting instance max memory to {limit} bytes"); let mut args = TriggerAppArgs::default(); args.max_instance_memory = limit.parse().ok(); args diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 5bcf6498..61800f84 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.86.0" +channel = "1.88.0" components = ["clippy", "rustfmt"] targets = ["wasm32-wasip1", "wasm32-unknown-unknown"] profile = "default" diff --git a/tests/src/integration_test.rs b/tests/src/integration_test.rs index 111d38fe..7b65a0b1 100644 --- a/tests/src/integration_test.rs +++ b/tests/src/integration_test.rs @@ -31,13 +31,13 @@ mod test { // verify res is ok and not 404 match res { Ok(_) => { - println!("response_code: {}", response_code); + println!("response_code: {response_code}"); if response_code / 100 == 2 { break; // 2xx response } } Err(e) => { - println!("res: {}, response_code: {}", e, response_code); + println!("res: {e}, response_code: {response_code}"); } } i += 1; @@ -55,9 +55,9 @@ mod test { let host_port = 8082; // curl for hello - println!(" >>> curl http://localhost:{}/spin/hello", host_port); + println!(" >>> curl http://localhost:{host_port}/spin/hello"); let res = retry_get( - &format!("http://localhost:{}/spin/hello", host_port), + &format!("http://localhost:{host_port}/spin/hello"), RETRY_TIMES, INTERVAL_IN_SECS, ) @@ -72,9 +72,9 @@ mod test { let host_port = 8082; // curl for hello - println!(" >>> curl http://localhost:{}/keyvalue/keyvalue", host_port); + println!(" >>> curl http://localhost:{host_port}/keyvalue/keyvalue"); let res = retry_get( - &format!("http://localhost:{}/keyvalue/keyvalue", host_port), + &format!("http://localhost:{host_port}/keyvalue/keyvalue"), RETRY_TIMES, INTERVAL_IN_SECS, ) @@ -96,16 +96,13 @@ mod test { let forward_port = port_forward_svc(redis_port, "redis").await?; - let client = redis::Client::open(format!("redis://localhost:{}", forward_port))?; + let client = redis::Client::open(format!("redis://localhost:{forward_port}"))?; let mut con = client.get_multiplexed_async_connection().await?; // curl for hello - println!( - " >>> curl http://localhost:{}/outboundredis/hello", - host_port - ); + println!(" >>> curl http://localhost:{host_port}/outboundredis/hello"); let _ = retry_get( - &format!("http://localhost:{}/outboundredis/hello", host_port), + &format!("http://localhost:{host_port}/outboundredis/hello"), RETRY_TIMES, INTERVAL_IN_SECS, ) @@ -126,9 +123,9 @@ mod test { let host_port = 8082; // curl for hello - println!(" >>> curl http://localhost:{}/multi-trigger-app", host_port); + println!(" >>> curl http://localhost:{host_port}/multi-trigger-app"); let res = retry_get( - &format!("http://localhost:{}/multi-trigger-app", host_port), + &format!("http://localhost:{host_port}/multi-trigger-app"), RETRY_TIMES, INTERVAL_IN_SECS, ) @@ -147,7 +144,7 @@ mod test { let forward_port = port_forward_svc(redis_port, "redis").await?; - let client = redis::Client::open(format!("redis://localhost:{}", forward_port)) + let client = redis::Client::open(format!("redis://localhost:{forward_port}")) .context("connecting to redis")?; let mut con = client.get_multiplexed_async_connection().await?; @@ -225,15 +222,9 @@ mod test { let host_port = 8082; // curl for static asset - println!( - " >>> curl http://localhost:{}/static-assets/jabberwocky.txt", - host_port - ); + println!(" >>> curl http://localhost:{host_port}/static-assets/jabberwocky.txt"); let res = retry_get( - &format!( - "http://localhost:{}/static-assets/jabberwocky.txt", - host_port - ), + &format!("http://localhost:{host_port}/static-assets/jabberwocky.txt"), RETRY_TIMES, INTERVAL_IN_SECS, ) @@ -260,15 +251,12 @@ mod test { async fn port_forward_svc(svc_port: u16, svc_name: &str) -> Result { let port = get_random_port()?; - println!( - " >>> kubectl portforward svc {} {}:{} ", - svc_name, port, svc_port - ); + println!(" >>> kubectl portforward svc {svc_name} {port}:{svc_port} "); Command::new("kubectl") .arg("port-forward") .arg(svc_name) - .arg(format!("{}:{}", port, svc_port)) + .arg(format!("{port}:{svc_port}")) .spawn()?; tokio::time::sleep(tokio::time::Duration::from_secs(2)).await; Ok(port)