Minor cleanups.

This commit is contained in:
Rasmus Kaj 2018-02-19 23:30:03 +01:00
parent 498548e3dd
commit 56b53e1607
2 changed files with 4 additions and 5 deletions

View File

@ -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"))

View File

@ -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")