File tree 2 files changed +9
-23
lines changed
2 files changed +9
-23
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
11
11
- Updates to Rust 2021 Edition. See [ PR 65] .
12
12
13
+ ### Removed
14
+
15
+ - Remove Add trait implementation for a private type. See [ PR 69] .
16
+
13
17
[ PR 65 ] : https://github.com/prometheus/client_rust/pull/65
18
+ [ PR 69 ] : https://github.com/prometheus/client_rust/pull/69
14
19
15
20
## [ 0.16.0]
16
21
Original file line number Diff line number Diff line change 3
3
//! See [`Registry`] for details.
4
4
5
5
use std:: borrow:: Cow ;
6
- use std:: ops:: Add ;
7
6
8
7
/// A metric registry.
9
8
///
@@ -149,7 +148,7 @@ impl<M> Registry<M> {
149
148
name : self
150
149
. prefix
151
150
. as_ref ( )
152
- . map ( |p| ( p. clone ( ) + "_" + name. as_str ( ) ) . into ( ) )
151
+ . map ( |p| ( p. clone ( ) . 0 + "_" + name. as_str ( ) ) )
153
152
. unwrap_or ( name) ,
154
153
help,
155
154
unit,
@@ -196,13 +195,9 @@ impl<M> Registry<M> {
196
195
/// but namespacing with a label instead of a metric name prefix.
197
196
pub fn sub_registry_with_prefix < P : AsRef < str > > ( & mut self , prefix : P ) -> & mut Self {
198
197
let sub_registry = Registry {
199
- prefix : Some (
200
- self . prefix
201
- . clone ( )
202
- . map ( |p| p + "_" )
203
- . unwrap_or_else ( || String :: new ( ) . into ( ) )
204
- + prefix. as_ref ( ) ,
205
- ) ,
198
+ prefix : Some ( Prefix (
199
+ self . prefix . clone ( ) . map ( |p| p. 0 + "_" ) . unwrap_or_default ( ) + prefix. as_ref ( ) ,
200
+ ) ) ,
206
201
labels : self . labels . clone ( ) ,
207
202
..Default :: default ( )
208
203
} ;
@@ -292,20 +287,6 @@ impl From<Prefix> for String {
292
287
}
293
288
}
294
289
295
- impl Add < & str > for Prefix {
296
- type Output = Self ;
297
- fn add ( self , rhs : & str ) -> Self :: Output {
298
- Prefix ( self . 0 + rhs)
299
- }
300
- }
301
-
302
- impl Add < & Prefix > for String {
303
- type Output = Self ;
304
- fn add ( self , rhs : & Prefix ) -> Self :: Output {
305
- self + rhs. 0 . as_str ( )
306
- }
307
- }
308
-
309
290
pub struct Descriptor {
310
291
name : String ,
311
292
help : String ,
You can’t perform that action at this time.
0 commit comments