pacesetter 0.0.1

Meta-framework on top of axum
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::Environment;
use clap::ArgMatches;

pub fn parse_env(sub_matches: &ArgMatches) -> Environment {
    let env = sub_matches
        .get_one::<String>("env")
        .map(|s| s.as_str())
        .unwrap_or("development");

    if env == "test" {
        Environment::Test
    } else if env == "production" {
        Environment::Production
    } else {
        Environment::Development
    }
}