mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2024-11-05 15:26:24 +01:00
app: apply review
This commit is contained in:
parent
18309ec919
commit
54401d2a21
|
@ -14,11 +14,16 @@ pub struct Config {
|
||||||
impl Config {
|
impl Config {
|
||||||
/// Get the configs from all possible places (args, file, env...)
|
/// Get the configs from all possible places (args, file, env...)
|
||||||
pub fn read(args: &CliConfigs) -> Self {
|
pub fn read(args: &CliConfigs) -> Self {
|
||||||
let config = if let Some(config) = &args.config_path {
|
// let config = if let Some(config) = &args.config_path {
|
||||||
Ok(config.clone())
|
// Ok(config.clone())
|
||||||
} else {
|
// } else {
|
||||||
find_config_file()
|
// find_config_file()
|
||||||
};
|
// };
|
||||||
|
let config = args
|
||||||
|
.config_path
|
||||||
|
.clone()
|
||||||
|
.ok_or(())
|
||||||
|
.or_else(|()| find_config_file());
|
||||||
|
|
||||||
// try to read a maybe existing config file
|
// try to read a maybe existing config file
|
||||||
let config = config.ok().and_then(|path| {
|
let config = config.ok().and_then(|path| {
|
||||||
|
|
Loading…
Reference in a new issue