You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: state.rs
    path of file: ./repos/youki/tests/contest/contest/src/tests/lifecycle
    
    the code of the file until where you have to start completion: use crate::utils::get_state;
use anyhow::{bail, Result};
use std::path::Path;

pub fn state(project_path: &Path, id: &str) -> Result<(
    
pub fn state(project_path: &Path, id: &str) -> Result<()> {
    match get_state(id, project_path) {
        Ok((stdout, stderr)) => {
            if stderr.contains("Error") || stderr.contains("error") {
                bail!("Error :\nstdout : {}\nstderr : {}", stdout, stderr)
            } else {
                // confirm that the status is stopped, as this is executed after the kill command
                if !(stdout.contains(&format!(r#""id": "{id}""#))
                    && stdout.contains(r#""status": "stopped""#))
                {
                    bail!("Expected state stopped, got : {}", stdout)
                } else {
                    Ok(())
                }
            }
        }
        Err(e) => Err(e.context("failed to get container state")),
    }
}