Autoformat

This commit is contained in:
Antoine Gersant 2017-09-21 21:38:09 -07:00
parent 12c5a1f731
commit 85f0b77b2b
2 changed files with 16 additions and 9 deletions

View file

@ -532,9 +532,10 @@ fn list_playlists(request: &mut Request, db: &DB) -> IronResult<Response> {
} }
let playlist_name = playlist::list_playlists(&username, db)?; let playlist_name = playlist::list_playlists(&username, db)?;
let playlists: Vec<ListPlaylistsOutput> = playlist_name.into_iter().map(|p| ListPlaylistsOutput{ let playlists: Vec<ListPlaylistsOutput> = playlist_name
name: p, .into_iter()
}).collect(); .map(|p| ListPlaylistsOutput { name: p })
.collect();
let result_json = serde_json::to_string(&playlists); let result_json = serde_json::to_string(&playlists);
let result_json = match result_json { let result_json = match result_json {

View file

@ -109,7 +109,9 @@ fn run() -> Result<()> {
options.optopt("w", "web", "set the path to web client files", "DIRECTORY"); options.optopt("w", "web", "set the path to web client files", "DIRECTORY");
#[cfg(unix)] #[cfg(unix)]
options.optflag("f", "foreground", "run polaris in the foreground instead of daemonizing"); options.optflag("f",
"foreground",
"run polaris in the foreground instead of daemonizing");
options.optflag("h", "help", "print this help menu"); options.optflag("h", "help", "print this help menu");
@ -178,7 +180,11 @@ fn run() -> Result<()> {
mount.mount("/", Static::new(web_dir_path)); mount.mount("/", Static::new(web_dir_path));
println!("Starting up server"); println!("Starting up server");
let port: u16 = matches.opt_str("p").unwrap_or("5050".to_owned()).parse().or(Err("invalid port number"))?; let port: u16 = matches
.opt_str("p")
.unwrap_or("5050".to_owned())
.parse()
.or(Err("invalid port number"))?;
let mut server = match Iron::new(mount).http(("0.0.0.0", port)) { let mut server = match Iron::new(mount).http(("0.0.0.0", port)) {
Ok(s) => s, Ok(s) => s,
Err(e) => bail!("Error starting up server: {}", e), Err(e) => bail!("Error starting up server: {}", e),