mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-21 16:41:01 -05:00
Merge pull request #716 from epage/update
chore: Upgrade winnow to 0.4.3
This commit is contained in:
commit
d399e2ea33
4 changed files with 21 additions and 29 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -2057,9 +2057,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
|
|||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.4.1"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28"
|
||||
checksum = "6dd168d560b787538a8ab920d47c030a5c0d488b515dd20798d59ea279a5b1df"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
|
|
@ -14,7 +14,7 @@ include.workspace = true
|
|||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
thiserror = "1.0"
|
||||
winnow = "0.4.1"
|
||||
winnow = "0.4.3"
|
||||
unicode-xid = "0.2.4"
|
||||
once_cell = "1.17.1"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
|
|
@ -125,16 +125,14 @@ impl<'s> Iterator for Utf8Chunks<'s> {
|
|||
}
|
||||
|
||||
mod parser {
|
||||
use winnow::branch::*;
|
||||
use winnow::bytes::*;
|
||||
use winnow::combinator::*;
|
||||
use winnow::prelude::*;
|
||||
use winnow::sequence::*;
|
||||
use winnow::stream::AsBStr;
|
||||
use winnow::stream::AsChar;
|
||||
use winnow::stream::SliceLen;
|
||||
use winnow::stream::Stream;
|
||||
use winnow::stream::StreamIsPartial;
|
||||
use winnow::token::*;
|
||||
|
||||
pub(crate) fn next_identifier<T>(input: T) -> IResult<T, <T as Stream>::Slice>
|
||||
where
|
||||
|
@ -257,8 +255,8 @@ mod parser {
|
|||
preceded(
|
||||
'#',
|
||||
alt((
|
||||
terminated(take_while_m_n(3, 8, is_lower_hex_digit), peek(sep1)),
|
||||
terminated(take_while_m_n(3, 8, is_upper_hex_digit), peek(sep1)),
|
||||
terminated(take_while(3..=8, is_lower_hex_digit), peek(sep1)),
|
||||
terminated(take_while(3..=8, is_upper_hex_digit), peek(sep1)),
|
||||
)),
|
||||
)
|
||||
.parse_next(input)
|
||||
|
@ -272,26 +270,26 @@ mod parser {
|
|||
{
|
||||
alt((
|
||||
(
|
||||
take_while_m_n(8, 8, is_lower_hex_digit),
|
||||
take_while(8, is_lower_hex_digit),
|
||||
'-',
|
||||
take_while_m_n(4, 4, is_lower_hex_digit),
|
||||
take_while(4, is_lower_hex_digit),
|
||||
'-',
|
||||
take_while_m_n(4, 4, is_lower_hex_digit),
|
||||
take_while(4, is_lower_hex_digit),
|
||||
'-',
|
||||
take_while_m_n(4, 4, is_lower_hex_digit),
|
||||
take_while(4, is_lower_hex_digit),
|
||||
'-',
|
||||
take_while_m_n(12, 12, is_lower_hex_digit),
|
||||
take_while(12, is_lower_hex_digit),
|
||||
),
|
||||
(
|
||||
take_while_m_n(8, 8, is_upper_hex_digit),
|
||||
take_while(8, is_upper_hex_digit),
|
||||
'-',
|
||||
take_while_m_n(4, 4, is_upper_hex_digit),
|
||||
take_while(4, is_upper_hex_digit),
|
||||
'-',
|
||||
take_while_m_n(4, 4, is_upper_hex_digit),
|
||||
take_while(4, is_upper_hex_digit),
|
||||
'-',
|
||||
take_while_m_n(4, 4, is_upper_hex_digit),
|
||||
take_while(4, is_upper_hex_digit),
|
||||
'-',
|
||||
take_while_m_n(12, 12, is_upper_hex_digit),
|
||||
take_while(12, is_upper_hex_digit),
|
||||
),
|
||||
))
|
||||
.recognize()
|
||||
|
@ -314,10 +312,9 @@ mod parser {
|
|||
// or more.
|
||||
|
||||
const IGNORE_HEX_MIN: usize = 32;
|
||||
const IGNORE_HEX_MAX: usize = usize::MAX;
|
||||
alt((
|
||||
take_while_m_n(IGNORE_HEX_MIN, IGNORE_HEX_MAX, is_lower_hex_digit),
|
||||
take_while_m_n(IGNORE_HEX_MIN, IGNORE_HEX_MAX, is_upper_hex_digit),
|
||||
take_while(IGNORE_HEX_MIN.., is_lower_hex_digit),
|
||||
take_while(IGNORE_HEX_MIN.., is_upper_hex_digit),
|
||||
))
|
||||
.parse_next(input)
|
||||
}
|
||||
|
@ -350,7 +347,7 @@ mod parser {
|
|||
}
|
||||
|
||||
let (after, _) =
|
||||
take_while_m_n(padding_len, padding_len, is_base64_padding).parse_next(padding)?;
|
||||
take_while(padding_len..=padding_len, is_base64_padding).parse_next(padding)?;
|
||||
|
||||
let after_offset = input.offset_to(&after);
|
||||
Ok(input.next_slice(after_offset))
|
||||
|
@ -439,12 +436,7 @@ mod parser {
|
|||
F: winnow::Parser<I, <I as Stream>::Slice, E>,
|
||||
E: winnow::error::ParseError<I>,
|
||||
{
|
||||
move |i: I| {
|
||||
winnow::multi::many0(f.by_ref())
|
||||
.map(|()| ())
|
||||
.recognize()
|
||||
.parse_next(i)
|
||||
}
|
||||
move |i: I| repeat0(f.by_ref()).map(|()| ()).recognize().parse_next(i)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
@ -16,7 +16,7 @@ parser = ["winnow"]
|
|||
flags = ["enumflags2"]
|
||||
|
||||
[dependencies]
|
||||
winnow = { version = "0.4.1", optional = true }
|
||||
winnow = { version = "0.4.3", optional = true }
|
||||
enumflags2 = { version = "0.7", optional = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
|
|
Loading…
Reference in a new issue