Skip to content

Commit aee31d4

Browse files
fix warnings maud_macros refs #121
1 parent f5ac79a commit aee31d4

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

maud_macros/src/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ use proc_macro::{Delimiter, Group, Literal, Span, TokenStream, TokenTree};
22
use proc_macro::quote;
33
use maud_htmlescape::Escaper;
44

5-
use std::iter::FromIterator;
6-
75
pub struct Builder {
86
output_ident: TokenTree,
97
stmts: Vec<TokenStream>,

maud_macros/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern crate proc_macro;
1010
mod parse;
1111
mod build;
1212

13-
use proc_macro::{Literal, Span, Term, TokenStream, TokenTree};
13+
use proc_macro::{Span, Term, TokenStream, TokenTree};
1414
use proc_macro::quote;
1515

1616
type ParseResult<T> = Result<T, String>;
@@ -34,9 +34,9 @@ fn expand(input: TokenStream) -> TokenStream {
3434
let output_ident = TokenTree::Term(Term::new("__maud_output", Span::def_site()));
3535
// Heuristic: the size of the resulting markup tends to correlate with the
3636
// code size of the template itself
37-
let size_hint = input.to_string().len();
38-
// QUESTION: u64_suffixed or unsuffixed?
39-
let size_hint = Literal::u64_unsuffixed(size_hint as u64);
37+
//
38+
// NOTE: can't get this to compile inside quote!
39+
//let size_hint = Literal::u64_unsuffixed(size_hint as u64);
4040
let stmts = match parse::parse(input, output_ident.clone()) {
4141
Ok(stmts) => stmts,
4242
Err(e) => panic!(e),

maud_macros/src/parse.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ use proc_macro::{
1010
};
1111

1212
use proc_macro::token_stream;
13-
use std::iter;
1413
use std::mem;
15-
use std::iter::FromIterator;
1614

1715
use literalext::LiteralExt;
1816

@@ -572,7 +570,7 @@ impl Parser {
572570

573571
/// Parses the given token stream as a Maud expression, returning a block of
574572
/// Rust code.
575-
fn block(&mut self, body: TokenStream, span: Span) -> ParseResult<TokenTree> {
573+
fn block(&mut self, body: TokenStream, _span: Span) -> ParseResult<TokenTree> {
576574
let mut builder = self.builder();
577575
self.with_input(body).markups(&mut builder)?;
578576
Ok(TokenTree::Group(Group::new(Delimiter::Brace, builder.build())))

0 commit comments

Comments
 (0)