Merge pull request #2 from fschutt/master

Remove synom
This commit is contained in:
Alex Crichton 2017-12-27 09:18:42 -06:00 committed by GitHub
commit c0e2cb3ac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -8,7 +8,6 @@ proc-macro = true
[dependencies]
syn = { git = 'https://github.com/dtolnay/syn', features = ['full'] }
synom = { git = 'https://github.com/dtolnay/syn' }
quote = { git = 'https://github.com/dtolnay/quote' }
proc-macro2 = { version = "0.1", features = ["unstable"] }
serde_json = "1"

View File

@ -1,7 +1,6 @@
#![feature(proc_macro)]
extern crate syn;
extern crate synom;
#[macro_use]
extern crate quote;
extern crate proc_macro;
@ -393,19 +392,19 @@ impl ToTokens for Receiver {
Receiver::FreeFunction(name) => name.to_tokens(tokens),
Receiver::StructFunction(s, name) => {
s.to_tokens(tokens);
syn::tokens::Colon2::default().to_tokens(tokens);
syn::token::Colon2::default().to_tokens(tokens);
name.to_tokens(tokens);
}
Receiver::StructMethod(_, mutable, name) => {
(my_quote! { me }).to_tokens(tokens);
syn::tokens::Dot::default().to_tokens(tokens);
syn::token::Dot::default().to_tokens(tokens);
if mutable {
syn::Ident::from("borrow_mut").to_tokens(tokens);
} else {
syn::Ident::from("borrow").to_tokens(tokens);
}
tokens.append_delimited("(", Default::default(), |_| ());
syn::tokens::Dot::default().to_tokens(tokens);
syn::token::Dot::default().to_tokens(tokens);
name.to_tokens(tokens);
}
}