Fix CI on trunk (#408)

CI was currently broken for two reasons

    trunk was not compliant with the 1.41 MSRV check
    clippy had new warnings

Since bincode 2.0 is not even in alpha yet MSRV should not be locked in place. This PR removes the MSRV checks for now. Additionally the few clippy warnings have been resolved.
This commit is contained in:
Lena Hellström 2021-10-07 14:20:55 +02:00 committed by GitHub
parent ed3c6f0712
commit 1a76db8540
3 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@
"stable",
"beta",
"nightly",
"1.41.0"
# "1.55.0" TODO: Pick latest stable version when we release 2.0
]
}
},

View File

@ -5,7 +5,7 @@
![CI](https://github.com/bincode-org/bincode/workflows/CI/badge.svg)
[![](https://meritbadge.herokuapp.com/bincode)](https://crates.io/crates/bincode)
[![](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![](https://img.shields.io/badge/bincode-rustc_1.41.1+-lightgray.svg)](https://blog.rust-lang.org/2020/02/27/Rust-1.41.1.html)
<!-- [![](https://img.shields.io/badge/bincode-rustc_1.41.1+-lightgray.svg)](https://blog.rust-lang.org/2020/02/27/Rust-1.41.1.html) -->
[![Matrix](https://img.shields.io/matrix/bincode:matrix.org?label=Matrix%20Chat)](https://matrix.to/#/#bincode:matrix.org)
A compact encoder / decoder pair that uses a binary zero-fluff encoding scheme.
@ -110,4 +110,4 @@ maximum size limit. Malicious inputs will fail upon deserialization.
### What is Bincode's MSRV (minimum supported Rust version)?
Bincode 2.0 maintains support for Rust 1.41.1. Any changes to this are considered a breaking change for semver purposes.
Bincode 2.0 is still in development and does not yet have a targetted MSRV. Once 2.0 is fully released the MSRV will be locked. After this point any changes to the MSRV are considered a breaking change for semver purposes.

View File

@ -188,7 +188,7 @@ impl<'storage> BincodeRead<'storage> for SliceReader<'storage> {
#[inline]
fn consume(&mut self, n: usize) {
self.slice = &self.slice.get(n..).unwrap_or_default();
self.slice = self.slice.get(n..).unwrap_or_default();
}
}
@ -225,7 +225,7 @@ where
fn get_byte_buffer(&mut self, length: usize) -> Result<Vec<u8>> {
self.fill_buffer(length)?;
Ok(::std::mem::replace(&mut self.temp_buffer, Vec::new()))
Ok(::std::mem::take(&mut self.temp_buffer))
}
fn forward_read_bytes<V>(&mut self, length: usize, visitor: V) -> Result<V::Value>
@ -255,7 +255,7 @@ where
<Self as std::io::Read>::read_exact(self, &mut temp_buf)?;
&temp_buf
};
let string = match ::std::str::from_utf8(&buf) {
let string = match ::std::str::from_utf8(buf) {
Ok(s) => s,
Err(e) => return Err(crate::ErrorKind::InvalidUtf8Encoding(e).into()),
};