Skip to content

Commit

Permalink
chore(codec): Use as_str method to implement display for CompressionE…
Browse files Browse the repository at this point in the history
…ncoding (#1765)
  • Loading branch information
tottoto authored Jul 2, 2024
1 parent 0f4fcdd commit cdfbf2a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tonic/src/codec/compression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,8 @@ impl CompressionEncoding {
}

impl fmt::Display for CompressionEncoding {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
#[cfg(feature = "gzip")]
CompressionEncoding::Gzip => write!(f, "gzip"),
#[cfg(feature = "zstd")]
CompressionEncoding::Zstd => write!(f, "zstd"),
}
f.write_str(self.as_str())
}
}

Expand Down

0 comments on commit cdfbf2a

Please sign in to comment.