Run 'cargo fmt' to format code (#489)
This commit is contained in:
committed by
Baptiste Gelez
parent
732f514da7
commit
b945d1f602
+15
-7
@@ -6,12 +6,12 @@ extern crate rpassword;
|
||||
|
||||
use clap::App;
|
||||
use diesel::Connection;
|
||||
use plume_models::{Connection as Conn, DATABASE_URL};
|
||||
use std::io::{self, prelude::*};
|
||||
use plume_models::{DATABASE_URL, Connection as Conn};
|
||||
|
||||
mod instance;
|
||||
mod users;
|
||||
mod search;
|
||||
mod users;
|
||||
|
||||
fn main() {
|
||||
let mut app = App::new("Plume CLI")
|
||||
@@ -27,10 +27,16 @@ fn main() {
|
||||
let conn = Conn::establish(DATABASE_URL.as_str());
|
||||
|
||||
match matches.subcommand() {
|
||||
("instance", Some(args)) => instance::run(args, &conn.expect("Couldn't connect to the database.")),
|
||||
("users", Some(args)) => users::run(args, &conn.expect("Couldn't connect to the database.")),
|
||||
("search", Some(args)) => search::run(args, &conn.expect("Couldn't connect to the database.")),
|
||||
_ => app.print_help().expect("Couldn't print help")
|
||||
("instance", Some(args)) => {
|
||||
instance::run(args, &conn.expect("Couldn't connect to the database."))
|
||||
}
|
||||
("users", Some(args)) => {
|
||||
users::run(args, &conn.expect("Couldn't connect to the database."))
|
||||
}
|
||||
("search", Some(args)) => {
|
||||
search::run(args, &conn.expect("Couldn't connect to the database."))
|
||||
}
|
||||
_ => app.print_help().expect("Couldn't print help"),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,7 +44,9 @@ pub fn ask_for(something: &str) -> String {
|
||||
print!("{}: ", something);
|
||||
io::stdout().flush().expect("Couldn't flush STDOUT");
|
||||
let mut input = String::new();
|
||||
io::stdin().read_line(&mut input).expect("Unable to read line");
|
||||
io::stdin()
|
||||
.read_line(&mut input)
|
||||
.expect("Unable to read line");
|
||||
input.retain(|c| c != '\n');
|
||||
input
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user