Skip to content

Commit 06572e7

Browse files
committed
Pass all testings🎉🎉
Signed-off-by: Folyd <[email protected]>
1 parent 34926d5 commit 06572e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/encoder/pb.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::io::Write;
44

5-
use protobuf::Message;
5+
use prost::Message;
66

77
use crate::errors::Result;
88
use crate::proto::MetricFamily;
@@ -31,7 +31,9 @@ impl Encoder for ProtobufEncoder {
3131
for mf in metric_families {
3232
// Fail-fast checks.
3333
check_metric_family(mf)?;
34-
mf.write_length_delimited_to_writer(writer)?;
34+
let mut buf = vec![];
35+
mf.encode_length_delimited(&mut buf)?;
36+
writer.write_all(buf.as_slice())?;
3537
}
3638
Ok(())
3739
}

0 commit comments

Comments
 (0)