INNER CODE UNIT · Rust

command_status

TheWaWaR/simple-http-server · src/config.rs:547

fn command_status(command: &mut ProcessCommand) -> io::Result<()> {
    let status = command.status()?;
    if status.success() {
        Ok(())
    } else {
        Err(io::Error::other(format!("command exited with {status}")))
    }
}

#[cfg(test)]
mod tests {
    use std::net::{Ipv4Addr, Ipv6Addr};

    use super::*;

    #[test]
    fn normalizes_base_url() {
        assert_eq!(normalize_base_url("/").unwrap(), "/");

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…