@@ -94,23 +94,9 @@ use std::process;
94
94
use std:: sync:: Arc ;
95
95
use std:: time:: { Duration , Instant } ;
96
96
97
- use measureme:: { EventId , EventIdBuilder , SerializableString , StringId } ;
97
+ use measureme:: { EventId , EventIdBuilder , Profiler , SerializableString , StringId } ;
98
98
use parking_lot:: RwLock ;
99
99
100
- cfg_if ! {
101
- if #[ cfg( any( windows, target_os = "wasi" ) ) ] {
102
- /// FileSerializationSink is faster on Windows
103
- type SerializationSink = measureme:: FileSerializationSink ;
104
- } else if #[ cfg( target_arch = "wasm32" ) ] {
105
- type SerializationSink = measureme:: ByteVecSink ;
106
- } else {
107
- /// MmapSerializatioSink is faster on macOS and Linux
108
- type SerializationSink = measureme:: MmapSerializationSink ;
109
- }
110
- }
111
-
112
- type Profiler = measureme:: Profiler < SerializationSink > ;
113
-
114
100
bitflags:: bitflags! {
115
101
struct EventFilter : u32 {
116
102
const GENERIC_ACTIVITIES = 1 << 0 ;
@@ -389,7 +375,7 @@ impl SelfProfiler {
389
375
output_directory : & Path ,
390
376
crate_name : Option < & str > ,
391
377
event_filters : & Option < Vec < String > > ,
392
- ) -> Result < SelfProfiler , Box < dyn Error > > {
378
+ ) -> Result < SelfProfiler , Box < dyn Error + Send + Sync > > {
393
379
fs:: create_dir_all ( output_directory) ?;
394
380
395
381
let crate_name = crate_name. unwrap_or ( "unknown-crate" ) ;
@@ -500,13 +486,13 @@ impl SelfProfiler {
500
486
self . event_filter_mask . contains ( EventFilter :: QUERY_KEYS )
501
487
}
502
488
503
- pub fn event_id_builder ( & self ) -> EventIdBuilder < ' _ , SerializationSink > {
489
+ pub fn event_id_builder ( & self ) -> EventIdBuilder < ' _ > {
504
490
EventIdBuilder :: new ( & self . profiler )
505
491
}
506
492
}
507
493
508
494
#[ must_use]
509
- pub struct TimingGuard < ' a > ( Option < measureme:: TimingGuard < ' a , SerializationSink > > ) ;
495
+ pub struct TimingGuard < ' a > ( Option < measureme:: TimingGuard < ' a > > ) ;
510
496
511
497
impl < ' a > TimingGuard < ' a > {
512
498
#[ inline]
0 commit comments