Skip to content

Commit 9873cd4

Browse files
authored
chore(codec): Remove resolved workaround (#2355)
1 parent cd8cc0c commit 9873cd4

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

tonic/src/codec/compression.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,13 @@ impl CompressionEncoding {
151151
}
152152
b"identity" => Ok(None),
153153
other => {
154-
// NOTE: Workaround for lifetime limitation. Resolved at Rust 1.79.
155-
// https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html#extending-automatic-temporary-lifetime-extension
156-
let other_debug_string;
154+
let other = match std::str::from_utf8(other) {
155+
Ok(s) => s,
156+
Err(_) => &format!("{other:?}"),
157+
};
157158

158159
let mut status = Status::unimplemented(format!(
159-
"Content is compressed with `{}` which isn't supported",
160-
match std::str::from_utf8(other) {
161-
Ok(s) => s,
162-
Err(_) => {
163-
other_debug_string = format!("{other:?}");
164-
&other_debug_string
165-
}
166-
}
160+
"Content is compressed with `{other}` which isn't supported"
167161
));
168162

169163
let header_value = enabled_encodings

0 commit comments

Comments
 (0)