Skip to content

Commit

Permalink
cleaning code
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Oct 2, 2024
1 parent 9c9e0a3 commit 6b6f5a6
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions bin/torii/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,9 @@ async fn main() -> anyhow::Result<()> {
})
.expect("Error setting Ctrl-C handler");

let mut tempfile = None;
if args.database.is_empty() {
tempfile = Some(NamedTempFile::new()?);
}

let database_path = if let Some(tempfile) = &tempfile {
tempfile.path().to_str().unwrap()
} else {
&args.database
};
let tempfile = NamedTempFile::new()?;
let database_path =
if args.database.is_empty() { tempfile.path().to_str().unwrap() } else { &args.database };

let mut options =
SqliteConnectOptions::from_str(database_path)?.create_if_missing(true).with_regexp();
Expand Down

0 comments on commit 6b6f5a6

Please sign in to comment.