We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fd7368 commit 317c8e4Copy full SHA for 317c8e4
src/main.rs
@@ -4,10 +4,10 @@ use std::env;
4
5
fn main() {
6
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());
+ let query = args.get(1).map_or("SELECT version()".to_string(), |arg| arg.to_string());
+ let format = args.get(2).map_or("CSV".to_string(), |arg| arg.to_string());
9
10
- match bindings::execute(query, format) {
+ match bindings::execute(&query, &format) {
11
Some(result) => println!("{}", result),
12
None => println!("Query execution failed."),
13
}
0 commit comments