Skip to content

Commit c854ee6

Browse files
authored
chore: relax msrv for most crates (#2378)
* chore: relax msrv for most crates * Keep MSRV 1.75 * Allow to compile with 1.75 again
1 parent edd281b commit c854ee6

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ jobs:
183183
rust-version: ${{ steps.msrv.outputs.version }}
184184
- uses: taiki-e/install-action@cargo-no-dev-deps
185185
- uses: Swatinem/rust-cache@v2
186-
- run: cargo no-dev-deps --no-private check --all-features
187-
- run: cargo no-dev-deps --no-private doc --no-deps --all-features
186+
# we exlude crates that do not use rust-version = { workspace = true }
187+
- run: cargo no-dev-deps --no-private check --all-features --workspace --exclude grpc --exclude tonic-protobuf\*
188+
- run: cargo no-dev-deps --no-private doc --no-deps --all-features --workspace --exclude grpc --exclude tonic-protobuf\*
188189
env:
189190
RUSTDOCFLAGS: "-D warnings"
190191

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ members = [
2929
resolver = "2"
3030

3131
[workspace.package]
32-
rust-version = "1.86"
32+
rust-version = "1.75"
3333

3434
[workspace.lints.rust]
3535
missing_debug_implementations = "warn"

grpc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.9.0-alpha.1"
44
edition = "2021"
55
authors = ["gRPC Authors"]
66
license = "MIT"
7+
rust-version = "1.86"
78

89
[dependencies]
910
bytes = "1.10.1"

tonic/src/codec/compression.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use bytes::{Buf, BufMut, BytesMut};
44
use flate2::read::{GzDecoder, GzEncoder};
55
#[cfg(feature = "deflate")]
66
use flate2::read::{ZlibDecoder, ZlibEncoder};
7-
use std::fmt;
7+
use std::{borrow::Cow, fmt};
88
#[cfg(feature = "zstd")]
99
use zstd::stream::read::{Decoder, Encoder};
1010

@@ -152,8 +152,8 @@ impl CompressionEncoding {
152152
b"identity" => Ok(None),
153153
other => {
154154
let other = match std::str::from_utf8(other) {
155-
Ok(s) => s,
156-
Err(_) => &format!("{other:?}"),
155+
Ok(s) => Cow::Borrowed(s),
156+
Err(_) => Cow::Owned(format!("{other:?}")),
157157
};
158158

159159
let mut status = Status::unimplemented(format!(

0 commit comments

Comments
 (0)