@@ -226,7 +226,7 @@ mod tests {
226
226
let ( measure, agg) = AggregateBuilder :: < u64 > :: new ( None , None ) . last_value ( ) ;
227
227
let mut a = Gauge {
228
228
data_points : vec ! [ DataPoint {
229
- attributes: AttributeSet :: from ( & [ KeyValue :: new( "a" , 1 ) ] [ .. ] ) ,
229
+ attributes: vec! [ KeyValue :: new( "a" , 1 ) ] ,
230
230
start_time: Some ( SystemTime :: now( ) ) ,
231
231
time: Some ( SystemTime :: now( ) ) ,
232
232
value: 1u64 ,
@@ -241,10 +241,7 @@ mod tests {
241
241
assert_eq ! ( count, 1 ) ;
242
242
assert ! ( new_agg. is_none( ) ) ;
243
243
assert_eq ! ( a. data_points. len( ) , 1 ) ;
244
- assert_eq ! (
245
- a. data_points[ 0 ] . attributes,
246
- AttributeSet :: from( & new_attributes[ ..] )
247
- ) ;
244
+ assert_eq ! ( a. data_points[ 0 ] . attributes, new_attributes. to_vec( ) ) ;
248
245
assert_eq ! ( a. data_points[ 0 ] . value, 2 ) ;
249
246
}
250
247
@@ -256,14 +253,14 @@ mod tests {
256
253
let mut a = Sum {
257
254
data_points : vec ! [
258
255
DataPoint {
259
- attributes: AttributeSet :: from ( & [ KeyValue :: new( "a1" , 1 ) ] [ .. ] ) ,
256
+ attributes: vec! [ KeyValue :: new( "a1" , 1 ) ] ,
260
257
start_time: Some ( SystemTime :: now( ) ) ,
261
258
time: Some ( SystemTime :: now( ) ) ,
262
259
value: 1u64 ,
263
260
exemplars: vec![ ] ,
264
261
} ,
265
262
DataPoint {
266
- attributes: AttributeSet :: from ( & [ KeyValue :: new( "a2" , 2 ) ] [ .. ] ) ,
263
+ attributes: vec! [ KeyValue :: new( "a2" , 1 ) ] ,
267
264
start_time: Some ( SystemTime :: now( ) ) ,
268
265
time: Some ( SystemTime :: now( ) ) ,
269
266
value: 2u64 ,
@@ -287,10 +284,7 @@ mod tests {
287
284
assert_eq ! ( a. temporality, temporality) ;
288
285
assert ! ( a. is_monotonic) ;
289
286
assert_eq ! ( a. data_points. len( ) , 1 ) ;
290
- assert_eq ! (
291
- a. data_points[ 0 ] . attributes,
292
- AttributeSet :: from( & new_attributes[ ..] )
293
- ) ;
287
+ assert_eq ! ( a. data_points[ 0 ] . attributes, new_attributes. to_vec( ) ) ;
294
288
assert_eq ! ( a. data_points[ 0 ] . value, 3 ) ;
295
289
}
296
290
}
@@ -302,14 +296,14 @@ mod tests {
302
296
let mut a = Sum {
303
297
data_points : vec ! [
304
298
DataPoint {
305
- attributes: AttributeSet :: from ( & [ KeyValue :: new( "a1" , 1 ) ] [ .. ] ) ,
299
+ attributes: vec! [ KeyValue :: new( "a1" , 1 ) ] ,
306
300
start_time: Some ( SystemTime :: now( ) ) ,
307
301
time: Some ( SystemTime :: now( ) ) ,
308
302
value: 1u64 ,
309
303
exemplars: vec![ ] ,
310
304
} ,
311
305
DataPoint {
312
- attributes: AttributeSet :: from ( & [ KeyValue :: new( "a2" , 2 ) ] [ .. ] ) ,
306
+ attributes: vec! [ KeyValue :: new( "a2" , 1 ) ] ,
313
307
start_time: Some ( SystemTime :: now( ) ) ,
314
308
time: Some ( SystemTime :: now( ) ) ,
315
309
value: 2u64 ,
@@ -333,10 +327,7 @@ mod tests {
333
327
assert_eq ! ( a. temporality, temporality) ;
334
328
assert ! ( a. is_monotonic) ;
335
329
assert_eq ! ( a. data_points. len( ) , 1 ) ;
336
- assert_eq ! (
337
- a. data_points[ 0 ] . attributes,
338
- AttributeSet :: from( & new_attributes[ ..] )
339
- ) ;
330
+ assert_eq ! ( a. data_points[ 0 ] . attributes, new_attributes. to_vec( ) ) ;
340
331
assert_eq ! ( a. data_points[ 0 ] . value, 3 ) ;
341
332
}
342
333
}
@@ -348,7 +339,7 @@ mod tests {
348
339
. explicit_bucket_histogram ( vec ! [ 1.0 ] , true , true ) ;
349
340
let mut a = Histogram {
350
341
data_points : vec ! [ HistogramDataPoint {
351
- attributes: AttributeSet :: from ( & [ KeyValue :: new( "a2 " , 2 ) ] [ .. ] ) ,
342
+ attributes: vec! [ KeyValue :: new( "a1 " , 1 ) ] ,
352
343
start_time: SystemTime :: now( ) ,
353
344
time: SystemTime :: now( ) ,
354
345
count: 2 ,
@@ -374,10 +365,7 @@ mod tests {
374
365
assert ! ( new_agg. is_none( ) ) ;
375
366
assert_eq ! ( a. temporality, temporality) ;
376
367
assert_eq ! ( a. data_points. len( ) , 1 ) ;
377
- assert_eq ! (
378
- a. data_points[ 0 ] . attributes,
379
- AttributeSet :: from( & new_attributes[ ..] )
380
- ) ;
368
+ assert_eq ! ( a. data_points[ 0 ] . attributes, new_attributes. to_vec( ) ) ;
381
369
assert_eq ! ( a. data_points[ 0 ] . count, 1 ) ;
382
370
assert_eq ! ( a. data_points[ 0 ] . bounds, vec![ 1.0 ] ) ;
383
371
assert_eq ! ( a. data_points[ 0 ] . bucket_counts, vec![ 0 , 1 ] ) ;
0 commit comments