Repository: starship/starship
File: src/modules/status.rs (Rust)

Code before:
        Some(ps) => match ps.len() > 1 {
            true => PipeStatusStatus::Pipe(ps),
            false => PipeStatusStatus::NoPipe,
        },
    };

    let pipestatus_status = match config.pipestatus {
        true => pipestatus_status,
        false => PipeStatusStatus::Disabled,
    };

    // Exit code is zero while success_symbol and pipestatus are all zero or disabled/missing
    if exit_code == "0"
        && config.success_symbol.is_empty()
        && (match pipestatus_status {
            PipeStatusStatus::Pipe(ps) => ps.iter().all(|s| s == "0"),
            _ => true,
        })
    {
        return None;
    }

    let segment_format = match config.pipestatus_segment_format {
        None => config.format,
        Some(format) => format,
    };

    // Create pipestatus string
    let pipestatus = match pipestatus_status {
        PipeStatusStatus::Pipe(pipestatus) => pipestatus
            .iter()
            .map(
                |ec| match format_exit_code(ec.as_str(), segment_format, None, &config, context) {
                    Ok(segments) => segments
                        .into_iter()
                        .map(|s| s.to_string())
                        .collect::<String>(),
                    Err(_) => "".to_string(),
                },
            )
            .collect::<Vec<String>>()
            .join(config.pipestatus_separator),
        _ => "".to_string(),
    };

    let main_format = match pipestatus_status {
        PipeStatusStatus::Pipe(_) => config.pipestatus_format,
        _ => config.format,
    };
    let parsed = format_exit_code(exit_code, main_format, Some(&pipestatus), &config, context);


Review comment (suggestion):
This is much simpler:
```suggestion
    let segment_format = config.pipestatus_segment_format.unwrap_or(config.format);
```

Code after:
        Some(ps) => match ps.len() > 1 {
            true => PipeStatusStatus::Pipe(ps),
            false => PipeStatusStatus::NoPipe,
        },
    };

    let pipestatus_status = match config.pipestatus {
        true => pipestatus_status,
        false => PipeStatusStatus::Disabled,
    };

    // Exit code is zero while success_symbol and pipestatus are all zero or disabled/missing
    if exit_code == "0"
        && config.success_symbol.is_empty()
        && (match pipestatus_status {
            PipeStatusStatus::Pipe(ps) => ps.iter().all(|s| s == "0"),
            _ => true,
        })
    {
        return None;
    }

    let segment_format = config.pipestatus_segment_format.unwrap_or(config.format);

    // Create pipestatus string
    let pipestatus = match pipestatus_status {
        PipeStatusStatus::Pipe(pipestatus) => pipestatus
            .iter()
            .map(
                |ec| match format_exit_code(ec.as_str(), segment_format, None, &config, context) {
                    Ok(segments) => segments
                        .into_iter()
                        .map(|s| s.to_string())
                        .collect::<String>(),
                    Err(_) => "".to_string(),
                },
            )
            .collect::<Vec<String>>()
            .join(config.pipestatus_separator),
        _ => "".to_string(),
    };

    let main_format = match pipestatus_status {
        PipeStatusStatus::Pipe(_) => config.pipestatus_format,
        _ => config.format,
    };
    let parsed = format_exit_code(exit_code, main_format, Some(&pipestatus), &config, context);

    module.set_segments(match parsed {
        Ok(segments) => segments,
        Err(_error) => {