geolith-dataset-builder 0.2.2

Raster datasets for geolith: district areas, normals, numbers and a map layer per period, and the steps that stage, verify and publish them to any S3-compatible bucket
Documentation
//! Exit codes that are part of the shell contract.
//!
//! `0` success, `1` failure, `2` usage (clap's own), `3` a probe or digest
//! refusal the operator must fix by hand (GDAL broken, boundary sha
//! mismatch). A verb returns this error type to leave with a code other
//! than `1`; `geolith_cli::exit_code` reads it back.

use std::fmt;

/// A process exit code other than the default `1`.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Exit(pub i32);

impl fmt::Display for Exit {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "exit {}", self.0)
    }
}

impl std::error::Error for Exit {}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn an_exit_prints_its_code() {
        assert_eq!(Exit(3).to_string(), "exit 3");
    }
}