diff options
author | Vypo Mouse <vypo@vypo.dev> | 2023-03-25 14:40:37 -0400 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-05-19 16:06:10 +0200 |
commit | 1856c4b57ca7ab706552e2c47f550c86e8999e7c (patch) | |
tree | 59f9e06dc1089799651fc27adee22687f52f16dd /askama_derive/src/generator.rs | |
parent | 4c98685b81509a59bf7719321eb2136d7dccca38 (diff) | |
download | askama-1856c4b57ca7ab706552e2c47f550c86e8999e7c.tar.gz askama-1856c4b57ca7ab706552e2c47f550c86e8999e7c.tar.bz2 askama-1856c4b57ca7ab706552e2c47f550c86e8999e7c.zip |
Update to rocket 0.5-rc.3
Diffstat (limited to 'askama_derive/src/generator.rs')
-rw-r--r-- | askama_derive/src/generator.rs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 05b3fc3..cdf5ebf 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -532,18 +532,27 @@ impl<'a> Generator<'a> { // Implement Rocket's `Responder`. #[cfg(feature = "with-rocket")] fn impl_rocket_responder(&mut self, buf: &mut Buffer) -> Result<(), CompileError> { - let lifetime = syn::Lifetime::new("'askama", proc_macro2::Span::call_site()); - let param = syn::GenericParam::Lifetime(syn::LifetimeParam::new(lifetime)); + let lifetime1 = syn::Lifetime::new("'askama1", proc_macro2::Span::call_site()); + let lifetime2 = syn::Lifetime::new("'askama2", proc_macro2::Span::call_site()); + + let mut param2 = syn::LifetimeParam::new(lifetime2); + param2.colon_token = Some(syn::Token![:](proc_macro2::Span::call_site())); + param2.bounds = syn::punctuated::Punctuated::new(); + param2.bounds.push_value(lifetime1.clone()); + + let param1 = syn::GenericParam::Lifetime(syn::LifetimeParam::new(lifetime1)); + let param2 = syn::GenericParam::Lifetime(param2); + self.write_header( buf, - "::askama_rocket::Responder<'askama, 'askama>", - Some(vec![param]), + "::askama_rocket::Responder<'askama1, 'askama2>", + Some(vec![param1, param2]), )?; buf.writeln("#[inline]")?; buf.writeln( - "fn respond_to(self, _: &::askama_rocket::Request) \ - -> ::askama_rocket::Result<'askama> {", + "fn respond_to(self, _: &'askama1 ::askama_rocket::Request) \ + -> ::askama_rocket::Result<'askama2> {", )?; buf.writeln("::askama_rocket::respond(&self)")?; |