diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a79242debf778a8db8a08ecee3499a2f1b7e1e4a..69cebc31a749713ee67ee14f7e33d319ebf43360 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,17 +3,18 @@ stages: - test - publish -build: +default: tags: - linux + - docker + +build: stage: build image: rust:latest script: - cargo build rustdoc: - tags: - - linux stage: build image: rust:latest script: @@ -23,16 +24,12 @@ rustdoc: - target/doc unit-test: - tags: - - linux stage: test image: rust:latest script: - cargo test --lib lint-test: - tags: - - linux stage: test image: rust:latest script: @@ -40,8 +37,6 @@ lint-test: - cargo clippy docs: - tags: - - linux stage: publish image: alpine dependencies: @@ -53,4 +48,4 @@ docs: paths: - public only: - - master \ No newline at end of file + - master diff --git a/Cargo.lock b/Cargo.lock index d6117f5b7e15f2514ae0a99bcbf5edf3d3c5f608..8a83a84bbc37ee377026504241bfb38793c9a6cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -637,7 +637,7 @@ dependencies = [ [[package]] name = "mquery" -version = "0.8.1" +version = "0.8.2" dependencies = [ "enum-as-inner", "mquery-macros", diff --git a/Cargo.toml b/Cargo.toml index b5606290705796d4e2bfd8d691e55e918de7217f..2c5e95ec3eb907c4f399ac1841cb174c49411ada 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mquery" -version = "0.8.1" +version = "0.8.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/utils.rs b/src/utils.rs index c47ccd3431222a460ff3fc47484fee401eb90af6..ad9c7086b2c89718a96d1fb470b20d2503fcd262 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -5,7 +5,7 @@ use prometheus_http_query::response::{InstantVector, RangeVector, Sample}; use rayon::prelude::*; -use serde::de::DeserializeOwned; +use serde::{de::DeserializeOwned, Deserialize}; use std::collections::HashMap; /// Helper trait for bulk type conversion of query result data @@ -99,7 +99,7 @@ pub fn convert_labels<T: DeserializeOwned>( /// This can be used directly to convert an [`InstantVector`] using `try_from` with type hinting, /// or use the [`Convert`] trait for bulk conversion of type `Vec<InstantVector>`. /// See the trait level docs for [`Convert`] for more information. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Deserialize)] pub struct CustomInstantVec<M> { pub labels: M, pub sample: Sample, @@ -122,6 +122,7 @@ impl<M: DeserializeOwned> TryFrom<InstantVector> for CustomInstantVec<M> { /// This can be used directly to convert a [`RangeVector`] using `try_from` with type hinting, /// or use the [`Convert`] trait for bulk conversion of type `Vec<InstantVector>`. /// See the trait level docs for [`Convert`] for more information. +#[derive(Clone, Debug, Deserialize)] pub struct CustomRangeVec<M> { pub labels: M, pub samples: Vec<Sample>,