From 2ab7df378d8cb40775ac0ecd2849fa9966386a2e Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Mon, 20 Mar 2023 16:57:44 +0200 Subject: Use clap to parse paths --- src/parser.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/parser.rs') diff --git a/src/parser.rs b/src/parser.rs index 9938924..6a6459b 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,5 +1,5 @@ use clap::{Parser, Subcommand}; -use std::str::FromStr; +use std::{path::PathBuf, str::FromStr}; use thiserror::Error; #[derive(Parser, Clone, Debug, PartialEq, Eq)] @@ -35,14 +35,14 @@ pub struct GitUploadPackArgs { pub stateless_rpc: bool, #[arg(long)] pub advertise_refs: bool, - pub directory: String, + pub directory: PathBuf, } #[derive(Parser, Clone, Debug, PartialEq, Eq)] pub struct GitReceivePackArgs { #[arg(long)] pub http_backend_info_refs: bool, - pub directory: String, + pub directory: PathBuf, } #[derive(Error, Debug)] @@ -98,7 +98,7 @@ mod test { timeout: None, stateless_rpc: true, advertise_refs: false, - directory: "foobar.git".to_owned(), + directory: PathBuf::from("foobar.git"), }) ); } -- cgit v1.2.3