Skip to content

Commit 3d496e7

Browse files
committed
use Compression enum instead of static src
1 parent c15e27c commit 3d496e7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

opentelemetry-otlp/src/exporter/tonic/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ impl TryFrom<Compression> for tonic::codec::CompressionEncoding {
5454
#[cfg(not(feature = "gzip-tonic"))]
5555
Compression::Gzip => Err(crate::Error::FeatureRequiredForCompressionAlgorithm(
5656
"gzip-tonic",
57-
"gzip",
57+
Compression::Gzip,
5858
)),
5959
#[cfg(feature = "zstd-tonic")]
6060
Compression::Zstd => Ok(tonic::codec::CompressionEncoding::Zstd),
6161
#[cfg(not(feature = "zstd-tonic"))]
6262
Compression::Zstd => Err(crate::Error::FeatureRequiredForCompressionAlgorithm(
6363
"zstd-tonic",
64-
"zstd",
64+
Compression::Zstd,
6565
)),
6666
}
6767
}

opentelemetry-otlp/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ pub enum Error {
377377
/// Feature required to use the specified compression algorithm.
378378
#[cfg(any(not(feature = "gzip-tonic"), not(feature = "zstd-tonic")))]
379379
#[error("feature '{0}' is required to use the compression algorithm '{1}'")]
380-
FeatureRequiredForCompressionAlgorithm(&'static str, &'static str),
380+
FeatureRequiredForCompressionAlgorithm(&'static str, Compression),
381381
}
382382

383383
#[cfg(feature = "grpc-tonic")]

0 commit comments

Comments
 (0)