@@ -98,7 +98,7 @@ impl LogViewerApp {
98
98
}
99
99
100
100
fn show_log_lines ( & mut self , ui : & mut egui:: Ui ) {
101
- #[ cfg( feature = "profiling" ) ]
101
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
102
102
puffin:: profile_scope!( "show_log_lines" ) ;
103
103
let text_height = egui:: TextStyle :: Body
104
104
. resolve ( ui. style ( ) )
@@ -227,7 +227,7 @@ impl LogViewerApp {
227
227
}
228
228
229
229
fn show_log_details ( & mut self , ui : & mut egui:: Ui ) {
230
- #[ cfg( feature = "profiling" ) ]
230
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
231
231
puffin:: profile_scope!( "show_log_details" ) ;
232
232
let Some ( data) = self . data . as_mut ( ) else {
233
233
ui. label ( "No data" ) ;
@@ -324,7 +324,7 @@ impl LogViewerApp {
324
324
self . loading_status = match Data :: try_from ( ( & self . data_display_options , & data[ ..] ) )
325
325
{
326
326
Ok ( mut data) => {
327
- #[ cfg( feature = "profiling" ) ]
327
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
328
328
puffin:: profile_scope!( "swap_data_after_load" ) ;
329
329
if let Some ( old_data) = self . data . as_mut ( ) {
330
330
// Preserve settings across loads of the data
@@ -514,7 +514,7 @@ impl LogViewerApp {
514
514
#[ cfg( not( target_arch = "wasm32" ) ) ]
515
515
/// Attempts to read the contents of the last loaded file and return it in a loading status otherwise returns an error loading status
516
516
fn reload_file ( & self ) -> LoadingStatus {
517
- #[ cfg( feature = "profiling" ) ]
517
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
518
518
puffin:: profile_scope!( "reload_file" ) ;
519
519
// TODO 5: Determine if this should spawn a task to do the load
520
520
let Some ( folder) = self . start_open_path . lock ( ) . unwrap ( ) . clone ( ) else {
@@ -532,7 +532,7 @@ impl LogViewerApp {
532
532
533
533
#[ cfg( not( target_arch = "wasm32" ) ) ]
534
534
fn load_most_recent_file ( & self ) -> LoadingStatus {
535
- #[ cfg( feature = "profiling" ) ]
535
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
536
536
puffin:: profile_scope!( "load_most_recent_file" ) ;
537
537
// TODO 5: Determine if this should spawn a task to do the load (might be able to reuse the normal load)
538
538
let Some ( folder) = self . start_open_path . lock ( ) . unwrap ( ) . clone ( ) else {
@@ -791,7 +791,7 @@ impl LogViewerApp {
791
791
}
792
792
793
793
fn is_changed_since_last_save ( & mut self ) -> bool {
794
- #[ cfg( feature = "profiling" ) ]
794
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
795
795
puffin:: profile_scope!( "is_changed_since_last_save" ) ;
796
796
let as_ron = match ron:: to_string ( & self ) {
797
797
Ok ( s) => s,
@@ -871,11 +871,11 @@ fn execute<F: std::future::Future<Output = Box<LoadingStatus>> + 'static>(
871
871
impl eframe:: App for LogViewerApp {
872
872
/// Called by the frame work to save state before shutdown.
873
873
fn save ( & mut self , storage : & mut dyn eframe:: Storage ) {
874
- #[ cfg( feature = "profiling" ) ]
874
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
875
875
puffin:: profile_scope!( "eframe::App::save" ) ;
876
876
if self . should_save ( ) {
877
877
info ! ( "Saving data" ) ;
878
- #[ cfg( feature = "profiling" ) ]
878
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
879
879
puffin:: profile_scope!( "Saving App State" ) ;
880
880
eframe:: set_value ( storage, eframe:: APP_KEY , self ) ;
881
881
} else {
@@ -885,11 +885,11 @@ impl eframe::App for LogViewerApp {
885
885
886
886
/// Called each time the UI needs repainting, which may be many times per second.
887
887
fn update ( & mut self , ctx : & egui:: Context , _frame : & mut eframe:: Frame ) {
888
- #[ cfg( feature = "profiling" ) ]
888
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
889
889
puffin:: profile_scope!( "update_loop" ) ;
890
890
egui:: TopBottomPanel :: top ( "top_panel" ) . show ( ctx, |ui| {
891
891
// The top panel is often a good place for a menu bar:
892
- #[ cfg( feature = "profiling" ) ]
892
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
893
893
puffin:: profile_scope!( "top_panel" ) ;
894
894
895
895
self . check_global_shortcuts ( ui) ;
@@ -912,7 +912,7 @@ impl eframe::App for LogViewerApp {
912
912
913
913
egui:: CentralPanel :: default ( ) . show ( ctx, |ui| {
914
914
// The central panel the region left after adding TopPanel's and SidePanel's
915
- #[ cfg( feature = "profiling" ) ]
915
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
916
916
puffin:: profile_scope!( "outer_central_panel" ) ;
917
917
static HEADING : LazyLock < & ' static str > =
918
918
LazyLock :: new ( || format ! ( "Log Viewer {}" , env!( "CARGO_PKG_VERSION" ) ) . leak ( ) ) ;
@@ -934,7 +934,7 @@ impl eframe::App for LogViewerApp {
934
934
. max_height ( max_details_height)
935
935
. min_height ( 60. )
936
936
. show_inside ( ui, |ui| {
937
- #[ cfg( feature = "profiling" ) ]
937
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
938
938
puffin:: profile_scope!( "bottom_panel" ) ;
939
939
ui. vertical_centered ( |ui| {
940
940
ui. heading ( "Details" ) ;
@@ -950,7 +950,7 @@ impl eframe::App for LogViewerApp {
950
950
} ) ;
951
951
952
952
egui:: CentralPanel :: default ( ) . show_inside ( ui, |ui| {
953
- #[ cfg( feature = "profiling" ) ]
953
+ #[ cfg( all ( not ( target_arch = "wasm32" ) , feature = "profiling" ) ) ]
954
954
puffin:: profile_scope!( "inner_central_panel" ) ;
955
955
egui:: ScrollArea :: horizontal ( )
956
956
. id_salt ( "log lines" )
0 commit comments