Skip to content

Commit

Permalink
Remove quote dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jan 19, 2024
1 parent f8001c1 commit 68ce6b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
1 change: 0 additions & 1 deletion askama_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ with-warp = []
parser = { package = "askama_parser", version = "0.2", path = "../askama_parser" }
mime = "0.3"
mime_guess = "2"
quote = "1"
serde = { version = "1.0", optional = true, features = ["derive"] }
basic-toml = { version = "0.1.1", optional = true }
15 changes: 2 additions & 13 deletions askama_derive/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use parser::node::{
Call, Comment, CondTest, If, Include, Let, Lit, Loop, Match, Target, Whitespace, Ws,
};
use parser::{Expr, Node};
use quote::quote;

pub(crate) struct Generator<'a> {
// The template input state: original struct AST and attributes
Expand Down Expand Up @@ -105,12 +104,7 @@ impl<'a> Generator<'a> {
};
if path_is_valid {
let path = path.to_str().unwrap();
buf.writeln(
&quote! {
include_bytes!(#path);
}
.to_string(),
)?;
buf.writeln(&format!("include_bytes!({path:?});"))?;
}
}

Expand Down Expand Up @@ -802,12 +796,7 @@ impl {generics_with_bounds} ::mendes::application::IntoResponse<A> for {type_nam
// Make sure the compiler understands that the generated code depends on the template file.
{
let path = path.to_str().unwrap();
buf.writeln(
&quote! {
include_bytes!(#path);
}
.to_string(),
)?;
buf.writeln(&format!("include_bytes!({path:?});"))?;
}

// We clone the context of the child in order to preserve their macros and imports.
Expand Down

0 comments on commit 68ce6b3

Please sign in to comment.