Minor cleanups.
This commit is contained in:
parent
498548e3dd
commit
56b53e1607
@ -156,10 +156,9 @@ pub fn run(args: &ArgMatches) -> Result<(), Error> {
|
||||
wrap3!(server.get "/{}/{}/{}", all_for_day: year, month, day);
|
||||
wrap3!(server.get "/thisday", on_this_day);
|
||||
|
||||
// https://github.com/rust-lang/rust/issues/20178
|
||||
let custom_handler: fn(&mut NickelError, &mut Request) -> Action =
|
||||
custom_errors;
|
||||
server.handle_error(custom_handler);
|
||||
server.handle_error(
|
||||
custom_errors as fn(&mut NickelError, &mut Request) -> Action
|
||||
);
|
||||
|
||||
server
|
||||
.listen(&*env_or("RPHOTOS_LISTEN", "127.0.0.1:6767"))
|
||||
|
@ -34,7 +34,7 @@ macro_rules! wrap3 {
|
||||
fn wrapped<'mw>(req: &mut Request,
|
||||
res: Response<'mw>)
|
||||
-> MiddlewareResult<'mw> {
|
||||
if let &Some(path) = &req.path_without_query() {
|
||||
if let Some(ref path) = req.path_without_query() {
|
||||
$handler(req, res, &path[$url.len()..])
|
||||
} else {
|
||||
res.not_found("Path missing")
|
||||
|
Loading…
Reference in New Issue
Block a user