Skip to content

Commit 69e6674

Browse files
authored
*/Cargo.toml: Update to 2021 edition (#65)
As suggested in #64, this commit update edition key of manifest file into 2021. As documented in 2021 edition guide(https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html), array.into_iter() now returns owned value instead of references, This commit changes previous doc comments to utilize new behavior. Signed-off-by: Doehyun Baek <[email protected]>
1 parent 63f0a92 commit 69e6674

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.17.0] - unreleased
8+
9+
### Changed
10+
11+
- Updates to Rust 2021 Edition. See [PR 65].
12+
13+
[PR 65]: https://github.com/prometheus/client_rust/pull/65
14+
715
## [0.16.0]
816

917
### Changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "prometheus-client"
3-
version = "0.16.0"
3+
version = "0.17.0"
44
authors = ["Max Inden <[email protected]>"]
5-
edition = "2018"
5+
edition = "2021"
66
description = "Open Metrics client library allowing users to natively instrument applications."
77
license = "Apache-2.0 OR MIT"
88
keywords = ["openmetrics", "prometheus", "metrics", "instrumentation", "monitoring"]
@@ -17,7 +17,7 @@ members = ["derive-text-encode"]
1717
dtoa = "1.0"
1818
itoa = "1.0"
1919
owning_ref = "0.4"
20-
prometheus-client-derive-text-encode = { version = "0.2.0", path = "derive-text-encode" }
20+
prometheus-client-derive-text-encode = { version = "0.3.0", path = "derive-text-encode" }
2121

2222
[dev-dependencies]
2323
async-std = { version = "1", features = ["attributes"] }

derive-text-encode/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "prometheus-client-derive-text-encode"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
authors = ["Max Inden <[email protected]>"]
5-
edition = "2018"
5+
edition = "2021"
66
description = "Auxiliary crate to derive text Encode trait from prometheus-client."
77
license = "Apache-2.0 OR MIT"
88
repository = "https://github.com/prometheus/client_rust"

src/metrics/family.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ pub trait MetricConstructor<M> {
144144
/// ```
145145
/// # use prometheus_client::metrics::family::{Family};
146146
/// # use prometheus_client::metrics::histogram::Histogram;
147-
/// let custom_buckets = vec![0.0, 10.0, 100.0];
147+
/// let custom_buckets = [0.0, 10.0, 100.0];
148148
/// let metric = Family::<(), Histogram, _>::new_with_constructor(|| {
149-
/// Histogram::new(custom_buckets.clone().into_iter())
149+
/// Histogram::new(custom_buckets.into_iter())
150150
/// });
151151
/// # metric.get_or_create(&());
152152
/// ```

src/metrics/histogram.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ use std::sync::{Arc, Mutex, MutexGuard};
2323
/// ```
2424
/// # use prometheus_client::metrics::histogram::Histogram;
2525
/// // Default values from go client(https://github.com/prometheus/client_golang/blob/5d584e2717ef525673736d72cd1d12e304f243d7/prometheus/histogram.go#L68)
26-
/// let histogram = Histogram::new(IntoIterator::into_iter([
26+
/// let custom_buckets = [
2727
/// 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0,
28-
/// ]));
28+
/// ];
29+
/// let histogram = Histogram::new(custom_buckets.into_iter());
2930
/// histogram.observe(4.2);
3031
/// ```
3132
// TODO: Consider using atomics. See

0 commit comments

Comments
 (0)