`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<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>
This commit is contained in:
parent
0b6ffc3b35
commit
9ac1f26516
|
|
@ -560,7 +560,7 @@ impl Runc {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the state of a container
|
/// 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 args = vec!["state".to_string(), id.to_string()];
|
||||||
let res = self.launch(self.command(&args)?, true).await?;
|
let res = self.launch(self.command(&args)?, true).await?;
|
||||||
serde_json::from_str(&res.output).map_err(Error::JsonDeserializationFailed)
|
serde_json::from_str(&res.output).map_err(Error::JsonDeserializationFailed)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue