Skip to content

Commit 0d0b499

Browse files
authored
Update nom to a recent version (#34)
This updates nom to version 7.
1 parent 217813f commit 0d0b499

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ codecov = { repository = "jonhoo/msql-srv", branch = "master", service = "github
2323
maintenance = { status = "experimental" }
2424

2525
[dependencies]
26-
nom = "5"
26+
nom = "7"
2727
mysql_common = { version = "0.28.0", features = ["chrono"] }
2828
byteorder = "1"
2929
chrono = "0.4"

src/lib.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,17 +267,22 @@ impl<B: MysqlShim<W>, R: Read, W: Write> MysqlIntermediary<B, R, W> {
267267
io::ErrorKind::UnexpectedEof,
268268
"client sent incomplete handshake",
269269
),
270-
nom::Err::Failure((input, nom_e_kind))
271-
| nom::Err::Error((input, nom_e_kind)) => {
272-
if let nom::error::ErrorKind::Eof = nom_e_kind {
270+
nom::Err::Failure(nom_error) | nom::Err::Error(nom_error) => {
271+
if let nom::error::ErrorKind::Eof = nom_error.code {
273272
io::Error::new(
274273
io::ErrorKind::UnexpectedEof,
275-
format!("client did not complete handshake; got {:?}", input),
274+
format!(
275+
"client did not complete handshake; got {:?}",
276+
nom_error.input
277+
),
276278
)
277279
} else {
278280
io::Error::new(
279281
io::ErrorKind::InvalidData,
280-
format!("bad client handshake; got {:?} ({:?})", input, nom_e_kind),
282+
format!(
283+
"bad client handshake; got {:?} ({:?})",
284+
nom_error.input, nom_error.code
285+
),
281286
)
282287
}
283288
}

src/packet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ fn packet(i: &[u8]) -> nom::IResult<&[u8], (u8, Packet<'_>)> {
195195
nom::sequence::pair(
196196
nom::multi::fold_many0(
197197
fullpacket,
198-
(0, None),
198+
|| (0, None),
199199
|(seq, pkt): (_, Option<Packet<'_>>), (nseq, p)| {
200200
let pkt = if let Some(mut pkt) = pkt {
201201
assert_eq!(nseq, seq + 1);

0 commit comments

Comments
 (0)