Skip to content

Commit

Permalink
chore(deps): update to winnow v0.6
Browse files Browse the repository at this point in the history
Also, update all the other dependencies, but the winnow update is the
biggest change with several API adjustments.
  • Loading branch information
dnaka91 committed Feb 14, 2024
1 parent 554b05b commit 83bfd8c
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 41 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rustc-hash = "1.1.0"
serde = { version = "1.0.196", features = ["derive"] }
serde_json = "1.0.113"
syn = "2.0.48"
thiserror = "1.0.56"
thiserror = "1.0.57"

[profile.release]
lto = "thin"
Expand Down
2 changes: 1 addition & 1 deletion crates/mabo-benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mabo-parser = { path = "../mabo-parser" }
mimalloc.workspace = true

[dev-dependencies]
divan = "0.1.11"
divan = "0.1.13"
indoc.workspace = true

[lints]
Expand Down
18 changes: 9 additions & 9 deletions crates/mabo-derive/src/cause.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ fn expand_winnow(ident: &Ident, variants: &[VariantInfo<'_>]) -> syn::Result<Tok
let ty = &v.fields[0].0.ty;

Ok(quote! {
impl<I> winnow::error::FromExternalError<I, #ty> for #ident {
fn from_external_error(_: &I, _: winnow::error::ErrorKind, e: #ty) -> Self {
impl<I> ::winnow::error::FromExternalError<I, #ty> for #ident {
fn from_external_error(_: &I, _: ::winnow::error::ErrorKind, e: #ty) -> Self {
Self::#variant_ident(e)
}
}
Expand All @@ -457,11 +457,11 @@ fn expand_winnow(ident: &Ident, variants: &[VariantInfo<'_>]) -> syn::Result<Tok
let ty = &v.fields[1].0.ty;

Ok(quote! {
impl<I> winnow::error::FromExternalError<I, #ty> for #ident
impl<I> ::winnow::error::FromExternalError<I, #ty> for #ident
where
I: winnow::stream::Location,
I: ::winnow::stream::Location,
{
fn from_external_error(input: &I, _: winnow::error::ErrorKind, e: #ty) -> Self {
fn from_external_error(input: &I, _: ::winnow::error::ErrorKind, e: #ty) -> Self {
Self::#variant_ident {
at: input.location(),
cause: e,
Expand All @@ -475,15 +475,15 @@ fn expand_winnow(ident: &Ident, variants: &[VariantInfo<'_>]) -> syn::Result<Tok
}).collect::<syn::Result<Vec<_>>>()?;

Ok(quote! {
impl<I> winnow::error::ParserError<I> for #ident
impl<I> ::winnow::error::ParserError<I> for #ident
where
I: winnow::stream::Location,
I: ::winnow::stream::Location + ::winnow::stream::Stream,
{
fn from_error_kind(input: &I, kind: winnow::error::ErrorKind) -> Self {
fn from_error_kind(input: &I, kind: ::winnow::error::ErrorKind) -> Self {
Self::Parser(kind, input.location())
}

fn append(self, _: &I, _: winnow::error::ErrorKind) -> Self {
fn append(self, _: &I, _: &I::Checkpoint, _: ::winnow::error::ErrorKind) -> Self {
self
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/mabo-derive/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn expand(derive: DeriveInput) -> syn::Result<TokenStream> {

impl<I> ::winnow::error::ParserError<I> for #ident
where
I: ::winnow::stream::Location,
I: ::winnow::stream::Location + ::winnow::stream::Stream,
{
fn from_error_kind(input: &I, kind: ::winnow::error::ErrorKind) -> Self {
Self{
Expand All @@ -57,7 +57,7 @@ pub fn expand(derive: DeriveInput) -> syn::Result<TokenStream> {
}
}

fn append(self, _: &I, _: ::winnow::error::ErrorKind) -> Self {
fn append(self, _: &I, _: &I::Checkpoint, _: ::winnow::error::ErrorKind) -> Self {
self
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/mabo-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ anstream.workspace = true
anstyle.workspace = true
mabo-derive = { path = "../mabo-derive" }
miette = { workspace = true, features = ["derive"] }
winnow = "0.5.39"
winnow = "0.6.0"

[dev-dependencies]
indoc.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions crates/mabo-parser/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ impl From<ParseDefinitionError> for ParseSchemaCause {

impl<I> winnow::error::ParserError<I> for ParseSchemaCause
where
I: winnow::stream::Location,
I: winnow::stream::Location + winnow::stream::Stream,
{
fn from_error_kind(input: &I, kind: winnow::error::ErrorKind) -> Self {
Self::Parser(kind, input.location())
}

fn append(self, _: &I, _: winnow::error::ErrorKind) -> Self {
fn append(self, _: &I, _: &I::Checkpoint, _: winnow::error::ErrorKind) -> Self {
self
}
}
Expand Down Expand Up @@ -248,13 +248,13 @@ impl From<ParseImportError> for ParseDefinitionError {

impl<I> winnow::error::ParserError<I> for ParseDefinitionError
where
I: winnow::stream::Location,
I: winnow::stream::Location + winnow::stream::Stream,
{
fn from_error_kind(input: &I, kind: winnow::error::ErrorKind) -> Self {
Self::Parser(kind, input.location())
}

fn append(self, _: &I, _: winnow::error::ErrorKind) -> Self {
fn append(self, _: &I, _: &I::Checkpoint, _: winnow::error::ErrorKind) -> Self {
self
}
}
2 changes: 1 addition & 1 deletion crates/mabo-parser/src/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use winnow::{

pub fn from_until<const N: usize, I>(
mut input: Located<I>,
start: Checkpoint<<I as Stream>::Checkpoint>,
start: &Checkpoint<<I as Stream>::Checkpoint, Located<I>>,
chars: [char; N],
) -> Range<usize>
where
Expand Down
2 changes: 1 addition & 1 deletion crates/mabo-parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ mod comments {
.map(Comment)
.map_err(|e| {
e.map(|cause| ParseError {
at: location::from_until(*input, start, ['\n']),
at: location::from_until(*input, &start, ['\n']),
cause,
})
})
Expand Down
2 changes: 1 addition & 1 deletion crates/mabo-parser/src/parser/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub(super) fn parse<'i>(input: &mut Input<'i>) -> Result<Const<'i>, ParseError>
})
.map_err(|e| {
e.map(|cause| ParseError {
at: location::from_until(*input, start, [';']),
at: location::from_until(*input, &start, [';']),
cause,
})
})
Expand Down
2 changes: 1 addition & 1 deletion crates/mabo-parser/src/parser/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub(super) fn parse<'i>(input: &mut Input<'i>) -> Result<Fields<'i>, ParseError>
.parse_next(input)
.map_err(|e| {
e.map(|cause| ParseError {
at: location::from_until(*input, start, [',', '\n']),
at: location::from_until(*input, &start, [',', '\n']),
cause,
})
})
Expand Down
2 changes: 1 addition & 1 deletion crates/mabo-parser/src/parser/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub(super) fn parse<'i>(input: &mut Input<'i>) -> Result<Import<'i>, ParseError>
})
.map_err(|e| {
e.map(|cause| ParseError {
at: location::from_until(*input, start, [';']),
at: location::from_until(*input, &start, [';']),
cause,
})
})
Expand Down
2 changes: 1 addition & 1 deletion crates/mabo-parser/src/parser/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub(super) fn parse<'i>(input: &mut Input<'i>) -> Result<Module<'i>, ParseError>
})
.map_err(|e| {
e.map(|cause| ParseError {
at: location::from_until(*input, start, ['}', '\n']),
at: location::from_until(*input, &start, ['}', '\n']),
cause,
})
})
Expand Down
2 changes: 1 addition & 1 deletion crates/mabo-parser/src/parser/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub(super) fn parse<'i>(input: &mut Input<'i>) -> Result<Struct<'i>, ParseError>
})
.map_err(|e| {
e.map(|cause| ParseError {
at: location::from_until(*input, start, ['}', '\n']),
at: location::from_until(*input, &start, ['}', '\n']),
cause,
})
})
Expand Down

0 comments on commit 83bfd8c

Please sign in to comment.