Upgrade to syn/quote 1.0

Fresh off the presses let's start the update!
This commit is contained in:
Alex Crichton
2019-08-13 10:05:08 -07:00
parent 1d0c333a2b
commit 45b43905b4
13 changed files with 111 additions and 99 deletions

View File

@ -577,7 +577,7 @@ impl<'a> IdlType<'a> {
.path
.segments
.last()
.map(|p| p.value().ident == "JsValue")
.map(|p| p.ident == "JsValue")
.unwrap_or(false)
{
return Some(inner.clone());

View File

@ -121,7 +121,7 @@ fn parse(webidl_source: &str, allowed_types: Option<&[&str]>) -> Result<Program>
for import in program.imports.iter_mut() {
if let ast::ImportKind::Type(t) = &mut import.kind {
t.extends.retain(|n| {
let ident = &n.segments.last().unwrap().value().ident;
let ident = &n.segments.last().unwrap().ident;
first_pass_record.builtin_idents.contains(ident) || filter(&ident.to_string())
});
}

View File

@ -127,16 +127,18 @@ pub fn webidl_const_v_to_backend_const_v(v: &ConstValue) -> ast::ConstValue {
}
/// From `ident` and `Ty`, create `ident: Ty` for use in e.g. `fn(ident: Ty)`.
fn simple_fn_arg(ident: Ident, ty: syn::Type) -> syn::ArgCaptured {
syn::ArgCaptured {
pat: syn::Pat::Ident(syn::PatIdent {
fn simple_fn_arg(ident: Ident, ty: syn::Type) -> syn::PatType {
syn::PatType {
pat: Box::new(syn::Pat::Ident(syn::PatIdent {
attrs: Vec::new(),
by_ref: None,
mutability: None,
ident,
mutability: None,
subpat: None,
}),
})),
colon_token: Default::default(),
ty,
ty: Box::new(ty),
attrs: Vec::new(),
}
}