From 856a6b8ac68da34cafbcb567cee5f295ece86da1 Mon Sep 17 00:00:00 2001 From: taobun Date: Mon, 8 Mar 2021 14:48:48 +0700 Subject: [PATCH] Update dependency --- obi/obi-rs/Cargo.lock | 46 +++++++++---------- obi/obi-rs/obi-derive-internal/Cargo.toml | 4 +- obi/obi-rs/obi-derive-internal/src/helpers.rs | 4 +- .../obi-derive-internal/src/struct_dec.rs | 10 ++-- .../obi-derive-internal/src/struct_enc.rs | 10 ++-- .../obi-derive-internal/src/struct_schema.rs | 14 +++--- obi/obi-rs/obi-derive/Cargo.toml | 4 +- obi/obi-rs/obi/Cargo.toml | 2 +- 8 files changed, 46 insertions(+), 48 deletions(-) diff --git a/obi/obi-rs/Cargo.lock b/obi/obi-rs/Cargo.lock index ef6b1de89d..c57907ec1d 100644 --- a/obi/obi-rs/Cargo.lock +++ b/obi/obi-rs/Cargo.lock @@ -2,68 +2,66 @@ # It is not intended for manual editing. [[package]] name = "obi" -version = "0.1.0" +version = "0.1.1" dependencies = [ - "obi-derive 0.1.0", + "obi-derive", ] [[package]] name = "obi-derive" -version = "0.1.0" +version = "0.1.1" dependencies = [ - "obi-derive-internal 0.1.0", - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)", + "obi-derive-internal", + "quote 0.3.15", + "syn", ] [[package]] name = "obi-derive-internal" -version = "0.1.0" +version = "0.1.1" dependencies = [ - "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote 1.0.6", + "syn", ] [[package]] name = "proc-macro2" -version = "1.0.18" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid", ] [[package]] name = "quote" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" [[package]] name = "quote" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" dependencies = [ - "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", ] [[package]] name = "syn" -version = "1.0.30" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "123a78a3596b24fee53a6464ce52d8ecbf62241e6294c7e7fe12086cd161f512" dependencies = [ - "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote 1.0.6", + "unicode-xid", ] [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" -"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" -"checksum syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)" = "93a56fabc59dce20fe48b6c832cc249c713e7ed88fa28b0ee0a3bfcaae5fe4e2" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" diff --git a/obi/obi-rs/obi-derive-internal/Cargo.toml b/obi/obi-rs/obi-derive-internal/Cargo.toml index 60ddc2aa84..7d5517b031 100644 --- a/obi/obi-rs/obi-derive-internal/Cargo.toml +++ b/obi/obi-rs/obi-derive-internal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "obi-derive-internal" -version = "0.1.0" +version = "0.1.1" authors = ["Band Protocol "] edition = "2018" @@ -8,5 +8,5 @@ edition = "2018" [dependencies] proc-macro2 = "1" -syn = {version = "1", features = ["full", "fold"] } +syn = {version = "1.0.62", features = ["full", "fold"] } quote = "1" diff --git a/obi/obi-rs/obi-derive-internal/src/helpers.rs b/obi/obi-rs/obi-derive-internal/src/helpers.rs index 86b13648ef..9c07ead7d4 100644 --- a/obi/obi-rs/obi-derive-internal/src/helpers.rs +++ b/obi/obi-rs/obi-derive-internal/src/helpers.rs @@ -1,8 +1,8 @@ +use proc_macro2::TokenStream; use quote::quote; -use syn::export::TokenStream2; use syn::Generics; -pub fn declaration(ident_str: &String, generics: &Generics) -> (TokenStream2, Vec) { +pub fn declaration(ident_str: &String, generics: &Generics) -> (TokenStream, Vec) { let (_, _, where_clause_generics) = generics.split_for_impl(); // Generate function that returns the name of the type. let mut declaration_params = vec![]; diff --git a/obi/obi-rs/obi-derive-internal/src/struct_dec.rs b/obi/obi-rs/obi-derive-internal/src/struct_dec.rs index c451b7fc2f..0f4f08869e 100644 --- a/obi/obi-rs/obi-derive-internal/src/struct_dec.rs +++ b/obi/obi-rs/obi-derive-internal/src/struct_dec.rs @@ -1,14 +1,14 @@ +use proc_macro2::TokenStream; use quote::quote; -use syn::export::TokenStream2; use syn::{Fields, ItemStruct}; -pub fn struct_dec(input: &ItemStruct) -> syn::Result { +pub fn struct_dec(input: &ItemStruct) -> syn::Result { let name = &input.ident; let generics = &input.generics; - let mut decode_field_types = TokenStream2::new(); + let mut decode_field_types = TokenStream::new(); let return_value = match &input.fields { Fields::Named(fields) => { - let mut body = TokenStream2::new(); + let mut body = TokenStream::new(); for field in &fields.named { let field_name = field.ident.as_ref().unwrap(); let delta = { @@ -27,7 +27,7 @@ pub fn struct_dec(input: &ItemStruct) -> syn::Result { } } Fields::Unnamed(fields) => { - let mut body = TokenStream2::new(); + let mut body = TokenStream::new(); for _ in 0..fields.unnamed.len() { let delta = quote! { obi::OBIDecode::decode(buf)?, diff --git a/obi/obi-rs/obi-derive-internal/src/struct_enc.rs b/obi/obi-rs/obi-derive-internal/src/struct_enc.rs index d001641637..8b562817f1 100644 --- a/obi/obi-rs/obi-derive-internal/src/struct_enc.rs +++ b/obi/obi-rs/obi-derive-internal/src/struct_enc.rs @@ -1,12 +1,12 @@ +use proc_macro2::{Span, TokenStream}; use quote::quote; -use syn::export::{Span, TokenStream2}; use syn::{Fields, Index, ItemStruct}; -pub fn struct_enc(input: &ItemStruct) -> syn::Result { +pub fn struct_enc(input: &ItemStruct) -> syn::Result { let name = &input.ident; let generics = &input.generics; - let mut body = TokenStream2::new(); - let mut encode_field_types = TokenStream2::new(); + let mut body = TokenStream::new(); + let mut encode_field_types = TokenStream::new(); match &input.fields { Fields::Named(fields) => { for field in &fields.named { @@ -52,7 +52,7 @@ pub fn struct_enc(input: &ItemStruct) -> syn::Result { mod tests { use super::*; - fn assert_eq(expected: TokenStream2, actual: TokenStream2) { + fn assert_eq(expected: TokenStream, actual: TokenStream) { assert_eq!(expected.to_string(), actual.to_string()) } diff --git a/obi/obi-rs/obi-derive-internal/src/struct_schema.rs b/obi/obi-rs/obi-derive-internal/src/struct_schema.rs index ee2ea851e3..f393b00ecd 100644 --- a/obi/obi-rs/obi-derive-internal/src/struct_schema.rs +++ b/obi/obi-rs/obi-derive-internal/src/struct_schema.rs @@ -1,9 +1,9 @@ use crate::helpers::declaration; -use quote::quote; -use syn::export::{ToTokens, TokenStream2}; +use proc_macro2::TokenStream; +use quote::{quote, ToTokens}; use syn::{Fields, ItemStruct}; -pub fn process_struct(input: &ItemStruct) -> syn::Result { +pub fn process_struct(input: &ItemStruct) -> syn::Result { let name = &input.ident; let name_str = name.to_token_stream().to_string(); let generics = &input.generics; @@ -13,8 +13,8 @@ pub fn process_struct(input: &ItemStruct) -> syn::Result { // Generate function that returns the schema of required types. let mut fields_vec = vec![]; - let mut struct_fields = TokenStream2::new(); - let mut add_definitions_recursively_rec = TokenStream2::new(); + let mut struct_fields = TokenStream::new(); + let mut add_definitions_recursively_rec = TokenStream::new(); match &input.fields { Fields::Named(fields) => { for field in &fields.named { @@ -58,7 +58,7 @@ pub fn process_struct(input: &ItemStruct) -> syn::Result { let where_clause = if !where_clause.is_empty() { quote! { where #(#where_clause),*} } else { - TokenStream2::new() + TokenStream::new() }; Ok(quote! { impl #impl_generics obi::OBISchema for #name #ty_generics #where_clause { @@ -76,7 +76,7 @@ pub fn process_struct(input: &ItemStruct) -> syn::Result { mod tests { use super::*; - fn assert_eq(expected: TokenStream2, actual: TokenStream2) { + fn assert_eq(expected: TokenStream, actual: TokenStream) { assert_eq!(expected.to_string(), actual.to_string()) } diff --git a/obi/obi-rs/obi-derive/Cargo.toml b/obi/obi-rs/obi-derive/Cargo.toml index fa2772ea70..6d5860fc31 100644 --- a/obi/obi-rs/obi-derive/Cargo.toml +++ b/obi/obi-rs/obi-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "obi-derive" -version = "0.1.0" +version = "0.1.1" authors = ["Band Protocol "] edition = "2018" @@ -11,5 +11,5 @@ proc-macro = true [dependencies] obi-derive-internal = { path = "../obi-derive-internal"} -syn = {version = "1", features = ["full", "fold"] } +syn = {version = "1.0.62", features = ["full", "fold"] } quote = "0.3.15" diff --git a/obi/obi-rs/obi/Cargo.toml b/obi/obi-rs/obi/Cargo.toml index 895e69719d..4f5b5bca71 100644 --- a/obi/obi-rs/obi/Cargo.toml +++ b/obi/obi-rs/obi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "obi" -version = "0.1.0" +version = "0.1.1" authors = ["Band Protocol "] edition = "2018"