Skip to content

Commit

Permalink
Reduce chrono features
Browse files Browse the repository at this point in the history
  • Loading branch information
Guara92 committed Jul 4, 2022
1 parent 1f5a240 commit f57e557
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/mcasper/dogstatsd-rs"
keywords = ["datadog", "dogstatsd", "client"]

[dependencies]
chrono = "0.4"
chrono = { version = "0.4", optional = true, default-features = false, features = ["clock"] }

[features]
unstable = []
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl Options {
from_addr: from_addr.into(),
to_addr: to_addr.into(),
namespace: namespace.into(),
default_tags: default_tags
default_tags
}
}
}
Expand Down
36 changes: 18 additions & 18 deletions src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ impl<'a> Metric for TimeMetric<'a> {
impl<'a> TimeMetric<'a> {
pub fn new(stat: &'a str, start_time: &'a DateTime<Utc>, end_time: &'a DateTime<Utc>) -> Self {
TimeMetric {
start_time: start_time,
end_time: end_time,
stat: stat,
start_time,
end_time,
stat,
}
}
}
Expand All @@ -142,8 +142,8 @@ impl<'a> Metric for TimingMetric<'a> {
impl<'a> TimingMetric<'a> {
pub fn new(stat: &'a str, ms: i64) -> Self {
TimingMetric {
ms: ms,
stat: stat,
ms,
stat,
}
}
}
Expand All @@ -168,8 +168,8 @@ impl<'a> Metric for GaugeMetric<'a> {
impl<'a> GaugeMetric<'a> {
pub fn new(stat: &'a str, val: &'a str) -> Self {
GaugeMetric {
stat: stat,
val: val,
stat,
val,
}
}
}
Expand All @@ -194,8 +194,8 @@ impl<'a> Metric for HistogramMetric<'a> {
impl<'a> HistogramMetric<'a> {
pub fn new(stat: &'a str, val: &'a str) -> Self {
HistogramMetric {
stat: stat,
val: val,
stat,
val,
}
}
}
Expand All @@ -220,8 +220,8 @@ impl<'a>Metric for DistributionMetric<'a> {
impl<'a> DistributionMetric<'a> {
pub fn new(stat: &'a str, val: &'a str) -> Self {
DistributionMetric {
stat: stat,
val: val,
stat,
val,
}
}
}
Expand All @@ -246,8 +246,8 @@ impl<'a> Metric for SetMetric<'a> {
impl<'a> SetMetric<'a> {
pub fn new(stat: &'a str, val: &'a str) -> Self {
SetMetric {
stat: stat,
val: val,
stat,
val,
}
}
}
Expand Down Expand Up @@ -348,9 +348,9 @@ impl<'a> Metric for ServiceCheck<'a> {
impl<'a> ServiceCheck<'a> {
pub fn new(stat: &'a str, val: ServiceStatus, options: ServiceCheckOptions) -> Self {
ServiceCheck {
stat: stat,
val: val,
options: options,
stat,
val,
options,
}
}
}
Expand Down Expand Up @@ -384,8 +384,8 @@ impl<'a> Metric for Event<'a> {
impl<'a> Event<'a> {
pub fn new(title: &'a str, text: &'a str) -> Self {
Event {
title: title,
text: text,
title,
text,
}
}
}
Expand Down

0 comments on commit f57e557

Please sign in to comment.