Skip to content

Commit

Permalink
chore: fix winnow deprecation warnings (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jan 28, 2024
1 parent 4049e03 commit 126cf6a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
13 changes: 6 additions & 7 deletions crates/dyn-abi/src/coerce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ use hex::FromHexError;
use parser::utils::{array_parser, char_parser, spanned};
use winnow::{
ascii::{alpha0, alpha1, digit1, hex_digit0, hex_digit1, space0},
combinator::{cut_err, dispatch, fail, opt, preceded, success},
combinator::{cut_err, dispatch, empty, fail, opt, preceded, trace},
error::{
AddContext, ContextError, ErrMode, ErrorKind, FromExternalError, StrContext,
StrContextValue,
},
stream::Stream,
token::take_while,
trace::trace,
PResult, Parser,
};

Expand Down Expand Up @@ -294,8 +293,8 @@ fn bool(input: &mut &str) -> PResult<bool> {
trace(
"bool",
dispatch! {alpha1.context(StrContext::Label("boolean"));
"true" => success(true),
"false" => success(false),
"true" => empty.value(true),
"false" => empty.value(false),
_ => fail
}
.context(StrContext::Label("boolean")),
Expand Down Expand Up @@ -437,9 +436,9 @@ fn int_units(input: &mut &str) -> PResult<usize> {
trace(
"int_units",
dispatch! {alpha0;
"ether" => success(18),
"gwei" | "nano" | "nanoether" => success(9),
"" | "wei" => success(0),
"ether" => empty.value(18),
"gwei" | "nano" | "nanoether" => empty.value(9),
"" | "wei" => empty.value(0),
_ => fail,
},
)
Expand Down
2 changes: 1 addition & 1 deletion crates/sol-type-parser/src/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
};
use alloc::vec::Vec;
use core::fmt;
use winnow::{trace::trace, PResult, Parser};
use winnow::{combinator::trace, PResult, Parser};

// TODO: Parse visibility and state mutability

Expand Down
2 changes: 1 addition & 1 deletion crates/sol-type-parser/src/root.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{ident::identifier, is_valid_identifier, Error, Result};
use core::fmt;
use winnow::{trace::trace, PResult, Parser};
use winnow::{combinator::trace, PResult, Parser};

/// A root type, with no array suffixes. Corresponds to a single, non-sequence
/// type. This is the most basic type specifier.
Expand Down
2 changes: 1 addition & 1 deletion crates/sol-type-parser/src/stem.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{Error, Result, RootType, TupleSpecifier};
use winnow::{trace::trace, PResult, Parser};
use winnow::{combinator::trace, PResult, Parser};

/// A stem of a Solidity array type. It is either a root type, or a tuple type.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/sol-type-parser/src/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
Error, Result, TypeSpecifier,
};
use alloc::vec::Vec;
use winnow::{trace::trace, PResult, Parser};
use winnow::{combinator::trace, PResult, Parser};

/// A tuple specifier, with no array suffixes. Corresponds to a sequence of
/// types.
Expand Down
3 changes: 1 addition & 2 deletions crates/sol-type-parser/src/type_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ use alloc::vec::Vec;
use core::num::NonZeroUsize;
use winnow::{
ascii::digit0,
combinator::{cut_err, delimited, repeat},
combinator::{cut_err, delimited, repeat, trace},
error::{ErrMode, ErrorKind, FromExternalError},
trace::trace,
PResult, Parser,
};

Expand Down
3 changes: 1 addition & 2 deletions crates/sol-type-parser/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ use alloc::{string::String, vec::Vec};
use core::{slice, str};
use winnow::{
ascii::space0,
combinator::{cut_err, delimited, opt, preceded, separated, terminated},
combinator::{cut_err, delimited, opt, preceded, separated, terminated, trace},
error::{AddContext, ParserError, StrContext, StrContextValue},
stream::Accumulate,
trace::trace,
PResult, Parser,
};

Expand Down

0 comments on commit 126cf6a

Please sign in to comment.