diff options
author | mitchmindtree <mail@mitchellnordine.com> | 2022-07-22 15:10:05 +1000 |
---|---|---|
committer | mitchmindtree <mail@mitchellnordine.com> | 2022-07-22 15:15:12 +1000 |
commit | 13035baeae417e41ce98f49c072220de0e6e4075 (patch) | |
tree | 2660d91405e3c242b137a682ac66c3d4a23035f1 | |
parent | 92afe9bd3c220eded410b91bffe8cf17d1eca129 (diff) |
Workaround rust nightly borrowcheck error (#1860)
Surprisingly, this fixes the error filed at #1860!
This seems suspicious, perhaps indicative of a bug in Rust's non-lexical
lifetime handling?
The lifetimes in the `handlebars::Renderable::render` method signature
are quite complicated, and its unclear to me whether or not Rust is
catching some new safety edge-case that wasn't previously handled
correctly...
Possibly related to `drop` order, which I *think* is related to the
order of binding statements?
-rw-r--r-- | src/renderer/html_handlebars/helpers/navigation.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/renderer/html_handlebars/helpers/navigation.rs b/src/renderer/html_handlebars/helpers/navigation.rs index d3f6ca90..65929bbf 100644 --- a/src/renderer/html_handlebars/helpers/navigation.rs +++ b/src/renderer/html_handlebars/helpers/navigation.rs @@ -149,8 +149,8 @@ fn render( _h.template() .ok_or_else(|| RenderError::new("Error with the handlebars template")) .and_then(|t| { - let mut local_rc = rc.clone(); let local_ctx = Context::wraps(&context)?; + let mut local_rc = rc.clone(); t.render(r, &local_ctx, &mut local_rc, out) })?; |