Skip to content

Commit

Permalink
tweak deserialization EOF detection logic
Browse files Browse the repository at this point in the history
The previous version would break on Rust 1.53.

More info: rust-lang/rust#84678
  • Loading branch information
antonok-edm committed Apr 29, 2021
1 parent 94b377c commit 6d1c02d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,8 @@ pub fn rules_from_lists(lists: &[String]) -> Vec<String> {
pub(crate) fn is_eof_error(e: &rmp_serde::decode::Error) -> bool {
if let rmp_serde::decode::Error::InvalidMarkerRead(e) = e {
if e.kind() == std::io::ErrorKind::UnexpectedEof {
if let Some(e) = e.get_ref() {
if format!("{}", e) == "failed to fill whole buffer" {
return true;
}
if format!("{}", e) == "failed to fill whole buffer" {
return true;
}
}
}
Expand Down

0 comments on commit 6d1c02d

Please sign in to comment.