aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/examples/server.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-15 15:07:12 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-15 15:07:12 -0700
commit525f21c871f4947196dc8348019d941e84bf6e3c (patch)
tree4d1b46c949c0a764affb7e744e08c937a916f258 /rust/fatcat-api/examples/server.rs
parent2fd925e4eb3730c36519096e4a74b2de5998e8d4 (diff)
downloadfatcat-525f21c871f4947196dc8348019d941e84bf6e3c.tar.gz
fatcat-525f21c871f4947196dc8348019d941e84bf6e3c.zip
make cargo fmt succeed by default
Diffstat (limited to 'rust/fatcat-api/examples/server.rs')
-rw-r--r--rust/fatcat-api/examples/server.rs16
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");
}
}