Skip to content

Commit f579dd4

Browse files
committed
fix: Encoder (cbindgen is stupid)
1 parent 2fd1d29 commit f579dd4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

datadog-profiling/src/profiles/compressor.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,16 @@ impl Write for SizeRestrictedBuffer {
5757
}
5858
}
5959

60-
type Encoder = zstd::Encoder<'static, SizeRestrictedBuffer>;
61-
6260
/// Used to compress profile data.
6361
pub struct Compressor {
64-
encoder: Encoder,
62+
encoder: zstd::Encoder<'static, SizeRestrictedBuffer>,
6563
}
6664

6765
impl Compressor {
6866
/// Creates a new compressor with the provided configuration.
6967
///
70-
/// - `size_hint`: beginning capacity for the output buffer. This is a
71-
/// hint for the starting size, and the implementation may use something
72-
/// different.
68+
/// - `size_hint`: beginning capacity for the output buffer. This is a hint for the starting
69+
/// size, and the implementation may use something different.
7370
/// - `max_capacity`: the maximum size for the output buffer (hard limit).
7471
/// - `compression_level`: see [`zstd::Encoder::new`] for the valid range.
7572
pub fn try_new(
@@ -78,7 +75,8 @@ impl Compressor {
7875
compression_level: i32,
7976
) -> io::Result<Compressor> {
8077
let buffer = SizeRestrictedBuffer::try_new(size_hint, max_capacity)?;
81-
let encoder = Encoder::new(buffer, compression_level)?;
78+
let encoder =
79+
zstd::Encoder::<'static, SizeRestrictedBuffer>::new(buffer, compression_level)?;
8280
Ok(Compressor { encoder })
8381
}
8482

0 commit comments

Comments
 (0)