Skip to content

Commit

Permalink
Remove the iron integration from generator
Browse files Browse the repository at this point in the history
Issue #527 removed the askama_iron package, but not the integration if
someone uses askama_derive's feature with "iron".

The old askama_iron crate uses askama v0.10, so it will still work.
  • Loading branch information
Kijewski authored and djc committed Jan 6, 2022
1 parent b7b5ff0 commit 8b4cc66
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 30 deletions.
1 change: 0 additions & 1 deletion askama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ num-traits = ["askama_shared/num-traits"]
with-actix-web = ["askama_derive/actix-web"]
with-axum = ["askama_derive/axum"]
with-gotham = ["askama_derive/gotham"]
with-iron = ["askama_derive/iron"]
with-mendes = ["askama_derive/mendes"]
with-rocket = ["askama_derive/rocket"]
with-tide = ["askama_derive/tide"]
Expand Down
1 change: 0 additions & 1 deletion askama_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ config = ["askama_shared/config"]
actix-web = []
axum = []
gotham = []
iron = []
mendes = []
rocket = []
tide = []
Expand Down
1 change: 0 additions & 1 deletion askama_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ const INTEGRATIONS: Integrations = Integrations {
actix: cfg!(feature = "actix-web"),
axum: cfg!(feature = "axum"),
gotham: cfg!(feature = "gotham"),
iron: cfg!(feature = "iron"),
mendes: cfg!(feature = "mendes"),
rocket: cfg!(feature = "rocket"),
tide: cfg!(feature = "tide"),
Expand Down
26 changes: 0 additions & 26 deletions askama_shared/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> {
if self.integrations.gotham {
self.impl_gotham_into_response(&mut buf)?;
}
if self.integrations.iron {
self.impl_iron_modifier_response(&mut buf)?;
}
if self.integrations.mendes {
self.impl_mendes_responder(&mut buf)?;
}
Expand Down Expand Up @@ -237,29 +234,6 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> {
buf.writeln("}")
}

// Implement iron's Modifier<Response> if enabled
fn impl_iron_modifier_response(&mut self, buf: &mut Buffer) -> Result<(), CompileError> {
self.write_header(
buf,
"::askama_iron::Modifier<::askama_iron::Response>",
None,
)?;
buf.writeln("fn modify(self, res: &mut ::askama_iron::Response) {")?;
buf.writeln(
"res.body = Some(Box::new(::askama_iron::Template::render(&self).unwrap().into_bytes()));",
)?;

match self.input.extension().unwrap_or("") {
"html" | "htm" => {
buf.writeln("::askama_iron::ContentType::html().0.modify(res);")?;
}
_ => (),
};

buf.writeln("}")?;
buf.writeln("}")
}

// Implement mendes' `Responder`.
fn impl_mendes_responder(&mut self, buf: &mut Buffer) -> Result<(), CompileError> {
let param = syn::parse_str("A: ::mendes::Application").unwrap();
Expand Down
1 change: 0 additions & 1 deletion askama_shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ pub struct Integrations {
pub actix: bool,
pub axum: bool,
pub gotham: bool,
pub iron: bool,
pub mendes: bool,
pub rocket: bool,
pub tide: bool,
Expand Down

0 comments on commit 8b4cc66

Please sign in to comment.