diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2019-02-20 20:02:56 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2019-02-20 20:43:40 +0100 |
commit | 23ff7ad636b4c0e26d3242747d50b7123831a1a8 (patch) | |
tree | d9ef104e34924acf28ab3b9fbd96a19a0648eb37 /askama_derive/src/generator.rs | |
parent | 292bf7baed7e96ab44085643f960014910835e53 (diff) | |
download | askama-23ff7ad636b4c0e26d3242747d50b7123831a1a8.tar.gz askama-23ff7ad636b4c0e26d3242747d50b7123831a1a8.tar.bz2 askama-23ff7ad636b4c0e26d3242747d50b7123831a1a8.zip |
Simplify actix-web implementations
Diffstat (limited to 'askama_derive/src/generator.rs')
-rw-r--r-- | askama_derive/src/generator.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 8f2866e..4a6eb89 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -234,11 +234,8 @@ impl<'a> Generator<'a> { -> ::std::result::Result<Self::Item, Self::Error> {", ); - let ext = match self.input.path.extension() { - Some(s) => s.to_str().unwrap(), - None => "txt", - }; - buf.writeln(&format!("::askama::actix_web::respond(&self, {:?})", ext)); + buf.writeln("use ::askama::actix_web::TemplateIntoResponse;"); + buf.writeln("self.into_response()"); buf.writeln("}"); buf.writeln("}"); |