Skip to content

Commit 317c8e4

Browse files
authored
Update main.rs
1 parent 8fd7368 commit 317c8e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use std::env;
44

55
fn main() {
66
let args: Vec<String> = env::args().collect();
7-
let query = args.get(1).unwrap_or(&"SELECT version()".to_string());
8-
let format = args.get(2).unwrap_or(&"CSV".to_string());
7+
let query = args.get(1).map_or("SELECT version()".to_string(), |arg| arg.to_string());
8+
let format = args.get(2).map_or("CSV".to_string(), |arg| arg.to_string());
99

10-
match bindings::execute(query, format) {
10+
match bindings::execute(&query, &format) {
1111
Some(result) => println!("{}", result),
1212
None => println!("Query execution failed."),
1313
}

0 commit comments

Comments
 (0)