Skip to content

Commit 0b0ed83

Browse files
committed
fix: doctest
1 parent b6a502e commit 0b0ed83

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

iroh/src/endpoint.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,18 +1135,16 @@ impl Endpoint {
11351135
/// For example, the following snippet collects all metrics into a map:
11361136
/// ```rust
11371137
/// # use std::collections::BTreeMap;
1138-
/// # use iroh_metrics::{MetricsGroup, MetricValue, MetricsGroupSet};
1138+
/// # use iroh_metrics::{Metric, MetricsGroup, MetricValue, MetricsGroupSet};
11391139
/// # use iroh::endpoint::Endpoint;
11401140
/// # async fn wrapper() -> testresult::TestResult {
11411141
/// let endpoint = Endpoint::builder().bind().await?;
11421142
/// let metrics: BTreeMap<String, MetricValue> = endpoint
11431143
/// .metrics()
11441144
/// .iter()
1145-
/// .flat_map(|group| {
1146-
/// group.values().map(|item| {
1147-
/// let name = [group.name(), item.name].join(":");
1148-
/// (name, item.value)
1149-
/// })
1145+
/// .map(|(group, metric)| {
1146+
/// let name = [group, metric.name()].join(":");
1147+
/// (name, metric.value())
11501148
/// })
11511149
/// .collect();
11521150
///

0 commit comments

Comments
 (0)