Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 68ce6b3

Browse files
Remove quote dependency
1 parent f8001c1 commit 68ce6b3

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

askama_derive/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ with-warp = []
3434
parser = { package = "askama_parser", version = "0.2", path = "../askama_parser" }
3535
mime = "0.3"
3636
mime_guess = "2"
37-
quote = "1"
3837
serde = { version = "1.0", optional = true, features = ["derive"] }
3938
basic-toml = { version = "0.1.1", optional = true }

askama_derive/src/generator.rs

+2-13
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use parser::node::{
1111
Call, Comment, CondTest, If, Include, Let, Lit, Loop, Match, Target, Whitespace, Ws,
1212
};
1313
use parser::{Expr, Node};
14-
use quote::quote;
1514

1615
pub(crate) struct Generator<'a> {
1716
// The template input state: original struct AST and attributes
@@ -105,12 +104,7 @@ impl<'a> Generator<'a> {
105104
};
106105
if path_is_valid {
107106
let path = path.to_str().unwrap();
108-
buf.writeln(
109-
&quote! {
110-
include_bytes!(#path);
111-
}
112-
.to_string(),
113-
)?;
107+
buf.writeln(&format!("include_bytes!({path:?});"))?;
114108
}
115109
}
116110

@@ -802,12 +796,7 @@ impl {generics_with_bounds} ::mendes::application::IntoResponse<A> for {type_nam
802796
// Make sure the compiler understands that the generated code depends on the template file.
803797
{
804798
let path = path.to_str().unwrap();
805-
buf.writeln(
806-
&quote! {
807-
include_bytes!(#path);
808-
}
809-
.to_string(),
810-
)?;
799+
buf.writeln(&format!("include_bytes!({path:?});"))?;
811800
}
812801

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

0 commit comments

Comments
 (0)