From 9ac1f2651642cacad73ef7d96b582833d93c3e8e Mon Sep 17 00:00:00 2001 From: Andrew Baxter Date: Thu, 21 Dec 2023 17:23:27 +0900 Subject: [PATCH] `Runc::state()` returns wrong type with async feature It's a very small change so I figured it's simpler to open a PR than an issue first. The sync `state` method returns `Container` but for async returns `Vec`, and I couldn't locate an explanation for why these might be different so I assume it's a mistake. From a user perspective too I want Container rather than a usize vec. Signed-off-by: Andrew Baxter --- crates/runc/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/runc/src/lib.rs b/crates/runc/src/lib.rs index ccae60e..23518d1 100644 --- a/crates/runc/src/lib.rs +++ b/crates/runc/src/lib.rs @@ -560,7 +560,7 @@ impl Runc { } /// Return the state of a container - pub async fn state(&self, id: &str) -> Result> { + pub async fn state(&self, id: &str) -> Result { let args = vec!["state".to_string(), id.to_string()]; let res = self.launch(self.command(&args)?, true).await?; serde_json::from_str(&res.output).map_err(Error::JsonDeserializationFailed)