parent
eb4ef2f969
commit
b86ba7af85
3 changed files with 15 additions and 2 deletions
13
maud/tests/absolute_paths.rs
Normal file
13
maud/tests/absolute_paths.rs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#![feature(proc_macro_hygiene)]
|
||||||
|
|
||||||
|
// Make sure `std` is available but the prelude isn't
|
||||||
|
#![no_std]
|
||||||
|
extern crate std;
|
||||||
|
|
||||||
|
use maud::html;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn issue_170() {
|
||||||
|
let number = 42;
|
||||||
|
let _ = html! { (number) };
|
||||||
|
}
|
|
@ -84,7 +84,7 @@ impl Generator {
|
||||||
quote!({
|
quote!({
|
||||||
// Create a local trait alias so that autoref works
|
// Create a local trait alias so that autoref works
|
||||||
trait Render: maud::Render {
|
trait Render: maud::Render {
|
||||||
fn __maud_render_to(&self, output_ident: &mut String) {
|
fn __maud_render_to(&self, output_ident: &mut ::std::string::String) {
|
||||||
maud::Render::render_to(self, output_ident);
|
maud::Render::render_to(self, output_ident);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ fn expand(input: TokenStream) -> TokenStream {
|
||||||
let stmts = generate::generate(markups, output_ident.clone());
|
let stmts = generate::generate(markups, output_ident.clone());
|
||||||
quote!({
|
quote!({
|
||||||
extern crate maud;
|
extern crate maud;
|
||||||
let mut $output_ident = String::with_capacity($size_hint);
|
let mut $output_ident = ::std::string::String::with_capacity($size_hint);
|
||||||
$stmts
|
$stmts
|
||||||
maud::PreEscaped($output_ident)
|
maud::PreEscaped($output_ident)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue