Skip to content

Commit 82d6d91

Browse files
committed
syn: replace parse with parse2
1 parent 4016b9d commit 82d6d91

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

syn/src/attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ impl ParametrizedAttr {
538538
/// fusion takes a nested meta data.
539539
#[inline]
540540
pub fn fuse(&mut self, attr: &Attribute) -> Result<(), Error> {
541-
let args = MetaArgList::parse.parse(attr.tokens.clone().into())?;
541+
let args = MetaArgList::parse.parse2(attr.tokens.clone().into())?;
542542
for arg in args.list {
543543
match arg {
544544
// `#[ident("literal", ...)]`

syn/src/val.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl From<Option<LitStr>> for ArgValue {
118118

119119
impl From<Ident> for ArgValue {
120120
fn from(ident: Ident) -> Self {
121-
Path::from(PathSegment::parse.parse(quote! { #ident }.into()).unwrap()).into()
121+
Path::from(PathSegment::parse.parse2(quote! { #ident }.into()).unwrap()).into()
122122
}
123123
}
124124

@@ -304,7 +304,7 @@ impl TryFrom<ArgValue> for Path {
304304
fn try_from(value: ArgValue) -> Result<Self, Self::Error> {
305305
match value {
306306
ArgValue::Expr(expr) => Path::parse
307-
.parse(expr.to_token_stream().into())
307+
.parse2(expr.to_token_stream().into())
308308
.map_err(Error::from),
309309
ArgValue::Type(Type::Path(ty)) => Ok(ty.path),
310310
_ => Err(Error::ArgValueMustBeType),
@@ -318,10 +318,10 @@ impl TryFrom<ArgValue> for Expr {
318318
fn try_from(value: ArgValue) -> Result<Self, Self::Error> {
319319
match value {
320320
ArgValue::Literal(lit) => Expr::parse
321-
.parse(lit.to_token_stream().into())
321+
.parse2(lit.to_token_stream().into())
322322
.map_err(Error::from),
323323
ArgValue::Type(ty) => Expr::parse
324-
.parse(ty.to_token_stream().into())
324+
.parse2(ty.to_token_stream().into())
325325
.map_err(Error::from),
326326
ArgValue::Expr(expr) => Ok(expr),
327327
ArgValue::None => Err(Error::ArgValueMustBeExpr),
@@ -427,7 +427,7 @@ impl TryFrom<ArgValue> for Option<Path> {
427427
ArgValue::Type(Type::Path(ty)) => Ok(Some(ty.path)),
428428
ArgValue::Expr(expr) => Some(
429429
Path::parse
430-
.parse(expr.into_token_stream().into())
430+
.parse2(expr.into_token_stream().into())
431431
.map_err(Error::from),
432432
)
433433
.transpose(),
@@ -445,13 +445,13 @@ impl TryFrom<ArgValue> for Option<Expr> {
445445
ArgValue::Expr(expr) => Ok(Some(expr)),
446446
ArgValue::Type(ty) => Some(
447447
Expr::parse
448-
.parse(ty.into_token_stream().into())
448+
.parse2(ty.into_token_stream().into())
449449
.map_err(Error::from),
450450
)
451451
.transpose(),
452452
ArgValue::Literal(lit) => Some(
453453
Expr::parse
454-
.parse(lit.into_token_stream().into())
454+
.parse2(lit.into_token_stream().into())
455455
.map_err(Error::from),
456456
)
457457
.transpose(),

0 commit comments

Comments
 (0)