Skip to content

Commit 9c7878e

Browse files
committed
fixes
1 parent f3351e2 commit 9c7878e

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,9 @@ required-features = ["protobuf"]
8383
# More information: https://docs.rs/about/builds#cross-compiling
8484
[package.metadata.docs.rs]
8585
all-features = true
86+
87+
88+
[profile.bench]
89+
inherits = "release"
90+
debug = true
91+

build.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
use std::io::Result;
22

33
fn main() -> Result<()> {
4+
let proto_files = ["src/encoding/proto/openmetrics_data_model.proto"];
5+
let include_dirs = ["src/encoding/proto/"];
46
#[cfg(feature = "protobuf")]
57
prost_build::compile_protos(
6-
&["src/encoding/proto/openmetrics_data_model.proto"],
7-
&["src/encoding/proto/"],
8+
&proto_files,
9+
&include_dirs,
810
)?;
911

12+
for path in &proto_files {
13+
println!("cargo:rerun-if-changed={}", path);
14+
}
15+
for path in &include_dirs {
16+
println!("cargo:rerun-if-changed={}", path);
17+
}
1018
Ok(())
1119
}

src/encoding/protobuf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ impl MetricEncoder<'_> {
280280
sum: Some(openmetrics_data_model::histogram_value::Sum::DoubleValue(
281281
sum,
282282
)),
283+
..Default::default()
283284
},
284285
)),
285286
..Default::default()
@@ -342,6 +343,7 @@ impl MetricEncoder<'_> {
342343
positive_delta: positive_deltas.to_vec(),
343344
positive_count: Vec::new(),
344345
exemplars: Vec::new(),
346+
..Default::default()
345347
},
346348
)),
347349
..Default::default()

0 commit comments

Comments
 (0)