From b121f1f8e7f9d2022f60ee201ff716e9fc21927e Mon Sep 17 00:00:00 2001 From: Zhang Tianyang Date: Mon, 22 Jul 2024 11:13:51 +0800 Subject: [PATCH] shim: fix-ci feat: WasmEdge lib 0.13.5 Signed-off-by: Zhang Tianyang --- shim/src/io.rs | 10 ++++------ shim/src/task.rs | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/shim/src/io.rs b/shim/src/io.rs index e5f7f5f3..13d7545c 100644 --- a/shim/src/io.rs +++ b/shim/src/io.rs @@ -129,10 +129,8 @@ impl VsockIO { } Err(other!("timeout connect to port {}", self.port)) } -} -impl ToString for VsockIO { - fn to_string(&self) -> String { + fn convert_to_string(&self) -> String { if self.sock_path.is_empty() { String::new() } else { @@ -336,15 +334,15 @@ impl ContainerIoTransport for VSockTransport { } fn container_in(&self) -> String { - self.stdin.clone().unwrap_or_default().to_string() + self.stdin.clone().unwrap_or_default().convert_to_string() } fn container_out(&self) -> String { - self.stdout.clone().unwrap_or_default().to_string() + self.stdout.clone().unwrap_or_default().convert_to_string() } fn container_err(&self) -> String { - self.stderr.clone().unwrap_or_default().to_string() + self.stderr.clone().unwrap_or_default().convert_to_string() } async fn new_task_client(address: &str) -> Result { diff --git a/shim/src/task.rs b/shim/src/task.rs index 8f07ebaf..c481b5fb 100644 --- a/shim/src/task.rs +++ b/shim/src/task.rs @@ -255,7 +255,7 @@ where req_new.stderr = shim_io.container_err(); if !prepare_res.bundle.is_empty() { - req_new.bundle = prepare_res.bundle.clone(); + req_new.bundle.clone_from(&prepare_res.bundle); } let res = self.task.create(ctx, req_new).await?;