Skip to content

Commit

Permalink
fix: use std::result::Result instead of Result in handlebar_helper!()…
Browse files Browse the repository at this point in the history
… macro

It is often customary to define crate wide Error and Result type.
Something like:

type Error = ...
type Result<T> = std::result::Result<T, Error>

If such Result<T> type is in scope when calling the handlebar_helper!()
macro, compilation fails as the number of template argument is not the
same.

This commit modified macro to rely explicitely on std::result::Result<>
instead of the whatever Result type is in scope when the macro is
invoked.
  • Loading branch information
cmeuter-ingenico committed May 10, 2023
1 parent 27a9a9a commit edcbc92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ macro_rules! handlebars_helper {
r: &'reg $crate::Handlebars<'reg>,
_: &'rc $crate::Context,
_: &mut $crate::RenderContext<'reg, 'rc>,
) -> Result<$crate::ScopedJson<'rc>, $crate::RenderError> {
) -> std::result::Result<$crate::ScopedJson<'rc>, $crate::RenderError> {
let mut param_idx = 0;

$(
Expand Down

0 comments on commit edcbc92

Please sign in to comment.