summaryrefslogtreecommitdiffstats
path: root/rust/src/bin/fatcatd.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-23 18:27:04 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-24 15:21:32 -0700
commit11b1c4359779b4c9a7437af53028430f8372b287 (patch)
treeaa6e70dbcb0b05d68e4c611285b439b654800cc3 /rust/src/bin/fatcatd.rs
parentb335a14b08860499129e513ce274b640e5fbb11e (diff)
downloadfatcat-11b1c4359779b4c9a7437af53028430f8372b287.tar.gz
fatcat-11b1c4359779b4c9a7437af53028430f8372b287.zip
rust fmt
Diffstat (limited to 'rust/src/bin/fatcatd.rs')
-rw-r--r--rust/src/bin/fatcatd.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/rust/src/bin/fatcatd.rs b/rust/src/bin/fatcatd.rs
index d4bc2683..53df7f71 100644
--- a/rust/src/bin/fatcatd.rs
+++ b/rust/src/bin/fatcatd.rs
@@ -17,8 +17,8 @@ extern crate slog_async;
extern crate slog_term;
use clap::{App, Arg};
-use iron::{Chain, Iron, IronResult, Response, Request, status, Url};
use iron::modifiers::RedirectRaw;
+use iron::{status, Chain, Iron, IronResult, Request, Response, Url};
use iron_slog::{DefaultLogFormatter, LoggerMiddleware};
use slog::{Drain, Logger};
//use dotenv::dotenv;
@@ -51,14 +51,24 @@ fn main() {
fn root_handler(_: &mut Request) -> IronResult<Response> {
//Ok(Response::with((status::Found, Redirect(Url::parse("/swagger-ui").unwrap()))))
- Ok(Response::with((status::Found, RedirectRaw("/swagger-ui".to_string()))))
+ Ok(Response::with((
+ status::Found,
+ RedirectRaw("/swagger-ui".to_string()),
+ )))
}
fn swaggerui_handler(_: &mut Request) -> IronResult<Response> {
let html_type = "text/html".parse::<iron::mime::Mime>().unwrap();
- Ok(Response::with((html_type, status::Ok, include_str!("../../swagger-ui/index.html"))))
+ Ok(Response::with((
+ html_type,
+ status::Ok,
+ include_str!("../../swagger-ui/index.html"),
+ )))
}
fn yaml_handler(_: &mut Request) -> IronResult<Response> {
- Ok(Response::with((status::Ok, include_str!("../../fatcat-openapi2.yml"))))
+ Ok(Response::with((
+ status::Ok,
+ include_str!("../../fatcat-openapi2.yml"),
+ )))
}
let mut chain = Chain::new(LoggerMiddleware::new(router, logger, formatter));