Fix errors![...] macro

In most applications, Rocket "lives" in the parent module. But sometimes, it
might be useful to encapsulate all Rocket code in a distict module like
`my_crate::http`.

In that case, rocket needs to be addressed with a absolute path instead of a
relative path. While the routes![...] macro does this correct, the errors![...]
macro did not.

This commit fixes the errors![...] macro.
This commit is contained in:
Tobias Stolzmann 2017-09-13 12:02:17 +02:00
parent 322c02f654
commit 75aff7ad8e
1 changed files with 1 additions and 1 deletions

View File

@ -56,6 +56,6 @@ pub fn routes(ecx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
pub fn errors(ecx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
-> Box<MacResult + 'static> {
prefixing_vec_macro(CATCH_STRUCT_PREFIX, |ecx, path| {
quote_expr!(ecx, rocket::Catcher::from(&$path))
quote_expr!(ecx, ::rocket::Catcher::from(&$path))
}, ecx, sp, args)
}