diff options
Diffstat (limited to 'rust/fatcat-api/examples/server.rs')
-rw-r--r-- | rust/fatcat-api/examples/server.rs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/rust/fatcat-api/examples/server.rs b/rust/fatcat-api/examples/server.rs index e97d69ca..612ec4b2 100644 --- a/rust/fatcat-api/examples/server.rs +++ b/rust/fatcat-api/examples/server.rs @@ -43,13 +43,7 @@ fn ssl() -> Result<OpensslServer, ErrorStack> { /// Create custom server, wire it to the autogenerated router, /// and pass it to the web server. fn main() { - let matches = App::new("server") - .arg( - Arg::with_name("https") - .long("https") - .help("Whether to use HTTPS or not"), - ) - .get_matches(); + let matches = App::new("server").arg(Arg::with_name("https").long("https").help("Whether to use HTTPS or not")).get_matches(); let server = server_lib::server().unwrap(); let router = fatcat::router(server); @@ -62,13 +56,9 @@ fn main() { if matches.is_present("https") { // Using Simple HTTPS - Iron::new(chain) - .https("localhost:8080", ssl().expect("Failed to load SSL keys")) - .expect("Failed to start HTTPS server"); + Iron::new(chain).https("localhost:8080", ssl().expect("Failed to load SSL keys")).expect("Failed to start HTTPS server"); } else { // Using HTTP - Iron::new(chain) - .http("localhost:8080") - .expect("Failed to start HTTP server"); + Iron::new(chain).http("localhost:8080").expect("Failed to start HTTP server"); } } |