diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d58d7632..c5fffe64 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,6 +30,8 @@ jobs: run: cargo build - name: cargo test run: cargo test + - name: cargo test (no default features) + run: cargo test --no-default-features - name: cargo test (extra features) run: cargo test --no-default-features --features="${{ env['EXTRA_FEATURES'] }}" - name: cargo package @@ -72,6 +74,8 @@ jobs: default: true - run: cargo build - run: cargo test --no-run + - run: cargo build --no-default-features + - run: cargo test --no-default-features --no-run - run: cargo build --no-default-features --features="${{ env['EXTRA_FEATURES'] }}" - run: cargo test --no-default-features --features="${{ env['EXTRA_FEATURES'] }}" linting: @@ -90,6 +94,10 @@ jobs: run: cargo fmt --all -- --check -l - name: cargo clippy run: cargo clippy --all + - name: cargo clippy (no default features) + run: cargo clippy --all --no-default-features + - name: cargo clippy (extra features) + run: cargo clippy --all --no-default-features --features="${{ env['EXTRA_FEATURES'] }}" criterion: name: "Benchmarks (criterion)" runs-on: ubuntu-latest diff --git a/src/pulling_gauge.rs b/src/pulling_gauge.rs index 6fbe9633..feadac20 100644 --- a/src/pulling_gauge.rs +++ b/src/pulling_gauge.rs @@ -4,7 +4,6 @@ use crate::{ core::Collector, proto::{Gauge, Metric, MetricFamily, MetricType}, }; -use protobuf::RepeatedField; /// A [Gauge] that returns the value from a provided function on every collect run. /// @@ -76,7 +75,7 @@ impl Collector for PullingGauge { m.set_name(self.desc.fq_name.clone()); m.set_help(self.desc.help.clone()); m.set_field_type(MetricType::GAUGE); - m.set_metric(RepeatedField::from_vec(vec![self.metric()])); + m.set_metric(from_vec!(vec![self.metric()])); vec![m] } }