From 1a76db85408e7ba7cd191193a3f009023f111232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lena=20Hellstr=C3=B6m?= Date: Thu, 7 Oct 2021 14:20:55 +0200 Subject: [PATCH] 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. --- .github/workflows/rust.yml | 2 +- README.md | 4 ++-- src/de/read.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 13e13e5..052d6fd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -25,7 +25,7 @@ "stable", "beta", "nightly", - "1.41.0" + # "1.55.0" TODO: Pick latest stable version when we release 2.0 ] } }, diff --git a/README.md b/README.md index 07c4f20..dbe0154 100644 --- a/README.md +++ b/README.md @@ -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) + [![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. diff --git a/src/de/read.rs b/src/de/read.rs index 8d6f8d9..5d3a92a 100644 --- a/src/de/read.rs +++ b/src/de/read.rs @@ -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> { 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(&mut self, length: usize, visitor: V) -> Result @@ -255,7 +255,7 @@ where ::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()), };