Skip to content

Commit a833aeb

Browse files
nepetcdecker
authored andcommitted
glcli: Refactor creation of data_dir
Signed-off-by: Peter Neuroth <[email protected]>
1 parent 9dd6943 commit a833aeb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/gl-cli/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ async fn run(cli: Cli) -> Result<()> {
5757
env_logger::init();
5858
}
5959

60-
let data_dir = match cli.data_dir {
61-
Some(d) => util::DataDir(PathBuf::from_str(&d).unwrap()),
62-
None => util::DataDir::default(),
63-
};
60+
let data_dir = cli
61+
.data_dir
62+
.map(|d| util::DataDir(PathBuf::from_str(&d).expect("is not a valid path")))
63+
.unwrap_or_default();
6464

6565
Ok(match cli.cmd {
6666
Commands::Scheduler(cmd) => {

0 commit comments

Comments
 (0)