Skip to content

Commit 6ce52cb

Browse files
committed
directly use path in args
1 parent e66ecf9 commit 6ce52cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::path::Path;
1+
use std::path::{Path, PathBuf};
22

33
use anyhow::Result;
44
use clap::Parser;
@@ -18,7 +18,7 @@ struct Args {
1818
required = true,
1919
help = "File path to scan. If a directory is specified, all contents will be scanned recursively."
2020
)]
21-
base_path: String,
21+
base_path: PathBuf,
2222

2323
/// Number of times to greet
2424
#[arg(
@@ -28,7 +28,7 @@ struct Args {
2828
default_value = "./musql.db3",
2929
help = "Path for the SQLite database that will be written to. It will be created if it does not exist."
3030
)]
31-
database_path: String,
31+
database_path: PathBuf,
3232
}
3333

3434
fn main() -> Result<()> {
@@ -39,7 +39,7 @@ fn main() -> Result<()> {
3939
musql(&args.base_path, &args.database_path)
4040
}
4141

42-
fn musql(base_path: &str, database_path: &str) -> Result<()> {
42+
fn musql(base_path: &Path, database_path: &Path) -> Result<()> {
4343
info!("Initializing database.");
4444
let mut conn = Connection::open(database_path)?;
4545
sql::init_schema(&conn)?;

0 commit comments

Comments
 (0)