Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump clap from 4.5.18 to 4.5.19 #281

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ version = "0.4.38"
[dependencies.clap]
default-features = false
features = ["suggestions", "color", "derive", "std", "cargo"]
version = "4.5.18"
version = "4.5.19"

[dependencies.elasticsearch]
default-features = false
Expand Down
1 change: 1 addition & 0 deletions src/bin/elasticsearch_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub fn panic_hook() {
mod cli;
use cli::{signal_channel, Opts};

#[allow(clippy::needless_return)]
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
panic_hook();
Expand Down
14 changes: 7 additions & 7 deletions src/metric/metric_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub enum MetricType {
Null,
}

impl<'s> TryFrom<RawMetric<'s>> for MetricType {
impl TryFrom<RawMetric<'_>> for MetricType {
type Error = MetricError;

fn try_from(metric: RawMetric) -> Result<Self, MetricError> {
Expand Down Expand Up @@ -158,19 +158,19 @@ impl<'s> TryFrom<RawMetric<'s>> for MetricType {
// pool_size is an int - MetricType::Gauge
"size" => {
// parse byte unit
return match parse_i64() {
match parse_i64() {
Ok(int) => Ok(MetricType::Gauge(int)),
Err(e) => {
if let Some(byte_str) = value.as_str() {
return Ok(MetricType::Gauge(
Ok(MetricType::Gauge(
// FIX: Possible accuracy loss (Prometheus accepts up to 64 bits)
Byte::from_str(byte_str).map(|b| b.as_u128()).or(Err(e))? as i64,
));
))
} else {
Err(e)
}

Err(e)
}
};
}
}

// docs_per_second -> second - https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html
Expand Down
2 changes: 1 addition & 1 deletion src/metric/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Metric {
}
}

impl<'s> TryFrom<RawMetric<'s>> for Metric {
impl TryFrom<RawMetric<'_>> for Metric {
type Error = MetricError;

fn try_from(metric: RawMetric) -> Result<Self, MetricError> {
Expand Down
Loading