@@ -183,9 +183,7 @@ pub trait OpenTelemetrySpanExt {
183
183
///
184
184
/// app_root.add_event("job_completed", vec![KeyValue::new("status", "success")]);
185
185
/// ```
186
- fn add_event < T > ( & self , name : T , attributes : Vec < KeyValue > )
187
- where
188
- T : Into < Cow < ' static , str > > ;
186
+ fn add_event ( & self , name : impl Into < Cow < ' static , str > > , attributes : Vec < KeyValue > ) ;
189
187
190
188
/// Adds an OpenTelemetry event with a specific timestamp directly to this span.
191
189
/// Similar to `add_event`, but allows overriding the event timestamp.
@@ -207,13 +205,12 @@ pub trait OpenTelemetrySpanExt {
207
205
///
208
206
/// app_root.add_event_with_timestamp(event_name, event_time, event_attrs);
209
207
/// ```
210
- fn add_event_with_timestamp < T > (
208
+ fn add_event_with_timestamp (
211
209
& self ,
212
- name : T ,
210
+ name : impl Into < Cow < ' static , str > > ,
213
211
timestamp : SystemTime ,
214
212
attributes : Vec < KeyValue > ,
215
- ) where
216
- T : Into < Cow < ' static , str > > ;
213
+ ) ;
217
214
}
218
215
219
216
impl OpenTelemetrySpanExt for tracing:: Span {
@@ -307,17 +304,16 @@ impl OpenTelemetrySpanExt for tracing::Span {
307
304
} ) ;
308
305
}
309
306
310
- fn add_event < T > ( & self , name : T , attributes : Vec < KeyValue > )
311
- where
312
- T : Into < Cow < ' static , str > > ,
313
- {
307
+ fn add_event ( & self , name : impl Into < Cow < ' static , str > > , attributes : Vec < KeyValue > ) {
314
308
self . add_event_with_timestamp ( name, time:: now ( ) , attributes) ;
315
309
}
316
310
317
- fn add_event_with_timestamp < T > ( & self , name : T , timestamp : SystemTime , attributes : Vec < KeyValue > )
318
- where
319
- T : Into < Cow < ' static , str > > ,
320
- {
311
+ fn add_event_with_timestamp (
312
+ & self ,
313
+ name : impl Into < Cow < ' static , str > > ,
314
+ timestamp : SystemTime ,
315
+ attributes : Vec < KeyValue > ,
316
+ ) {
321
317
self . with_subscriber ( move |( id, subscriber) | {
322
318
let mut event = Some ( opentelemetry:: trace:: Event :: new (
323
319
name, timestamp, attributes, 0 ,
0 commit comments