Skip to content

Commit

Permalink
Runc::state() returns wrong type with async feature
Browse files Browse the repository at this point in the history
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<usize>`, 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 <i@isandrew.com>
  • Loading branch information
andrewbaxter authored and mxpv committed Dec 25, 2023
1 parent 0b6ffc3 commit 9ac1f26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/runc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ impl Runc {
}

/// Return the state of a container
pub async fn state(&self, id: &str) -> Result<Vec<usize>> {
pub async fn state(&self, id: &str) -> Result<Container> {
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)
Expand Down

0 comments on commit 9ac1f26

Please sign in to comment.