Skip to content

Commit dd166f0

Browse files
authored
Bump syn from ~1.0 to ~2.0 (#138)
Signed-off-by: Thomas Farr <[email protected]>
1 parent c493acf commit dd166f0

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1616
- Bumps `aws-*` from >=0.10 to >=0.53 ([#108](https://github.com/opensearch-project/opensearch-rs/pull/108))
1717
- Bumps `toml` from 0.5.6 to 0.7.1
1818
- Bumps `sysinfo` from 0.26.4 to 0.28.0
19+
- Bumps `syn` from ~1.0 to ~2.0
1920

2021
### Changed
2122
- Updates users guide with complete examples ([#114](https://github.com/opensearch-project/opensearch-rs/pull/114))

api_generator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ semver = "1.0.14"
2828
serde = { version = "~1", features = ["derive"] }
2929
serde_json = "~1"
3030
simple_logger = "4.0.0"
31-
syn = { version = "~1.0", features = ["extra-traits", "full"] }
31+
syn = { version = "~2.0", features = ["extra-traits", "full"] }
3232
tar = "~0.4"
3333
toml = "0.7.1"
3434
url = "2.1.1"

api_generator/src/generator/code_gen/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl GetIdent for ImplItem {
188188
fn get_ident(&self) -> &syn::Ident {
189189
match self {
190190
ImplItem::Const(i) => &i.ident,
191-
ImplItem::Method(i) => &i.sig.ident,
191+
ImplItem::Fn(i) => &i.sig.ident,
192192
ImplItem::Type(i) => &i.ident,
193193
_ => panic!("{:?} has no ident", self),
194194
}
@@ -295,7 +295,7 @@ pub fn generics(lifetimes: Vec<syn::Lifetime>, types: Vec<syn::TypeParam>) -> sy
295295
let params: Punctuated<_, _> = lifetimes
296296
.into_iter()
297297
.map(|l| {
298-
syn::GenericParam::Lifetime(syn::LifetimeDef {
298+
syn::GenericParam::Lifetime(syn::LifetimeParam {
299299
attrs: vec![],
300300
lifetime: l,
301301
colon_token: None,
@@ -356,7 +356,7 @@ impl IntoStmt for syn::Item {
356356

357357
impl IntoStmt for syn::Expr {
358358
fn into_stmt(self) -> syn::Stmt {
359-
syn::Stmt::Expr(self)
359+
syn::Stmt::Expr(self, Some(syn::token::Semi(Span::call_site())))
360360
}
361361
}
362362

api_generator/src/generator/code_gen/url/enum_builder.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,10 @@ impl<'a> EnumBuilder<'a> {
223223
}),
224224
_ => syn::Pat::TupleStruct(syn::PatTupleStruct {
225225
attrs: vec![],
226+
qself: None,
226227
path: match_path,
227-
pat: syn::PatTuple {
228-
attrs: vec![],
229-
paren_token: Paren(Span::call_site()),
230-
elems: fields.into_iter().collect(),
231-
},
228+
paren_token: Paren(Span::call_site()),
229+
elems: fields.into_iter().collect(),
232230
}),
233231
};
234232

0 commit comments

Comments
 (0)