Skip to content

Commit d5963ed

Browse files
ctaggartbjorn3
andauthored
accept cfg_if suggestion
Co-Authored-By: bjorn3 <[email protected]>
1 parent f72de47 commit d5963ed

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

src/librustc_data_structures/profiling.rs

+7-17
Original file line numberDiff line numberDiff line change
@@ -98,24 +98,14 @@ use measureme::{EventId, EventIdBuilder, SerializableString, StringId};
9898
use parking_lot::RwLock;
9999

100100
cfg_if! {
101-
if #[cfg(target_arch = "wasm32")] {
102-
cfg_if! {
103-
if #[cfg(target_os = "wasi")] {
104-
type SerializationSink = measureme::FileSerializationSink;
105-
} else {
106-
type SerializationSink = measureme::ByteVecSink;
107-
}
108-
}
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;
109106
} else {
110-
cfg_if! {
111-
if #[cfg(windows)] {
112-
/// FileSerializationSink is faster on Windows
113-
type SerializationSink = measureme::FileSerializationSink;
114-
} else {
115-
/// MmapSerializatioSink is faster on macOS and Linux
116-
type SerializationSink = measureme::MmapSerializationSink;
117-
}
118-
}
107+
/// MmapSerializatioSink is faster on macOS and Linux
108+
type SerializationSink = measureme::MmapSerializationSink;
119109
}
120110
}
121111

0 commit comments

Comments
 (0)