Skip to content
Snippets Groups Projects
Select Git revision
  • d44882a8c8a1358bb4db68908c6d5ca1208d1ddc
  • master default
  • labcomm2006
  • typedefs
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.4
  • v2006.0
  • v2014.3
  • v2014.2
  • v2014.1
  • v2014.0
  • v2013.0
16 results

PrettyPrint.jrag

Blame
  • Forked from Anders Blomdell / LabComm
    Source project has a limited visibility.
    main.rs 1.05 KiB
    #![warn(clippy::all, rust_2018_idioms)]
    #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
    
    // When compiling natively:
    #[cfg(not(target_arch = "wasm32"))]
    fn main() {
        // Log to stdout (if you run with `RUST_LOG=debug`).
        tracing_subscriber::fmt::init();
    
        let native_options = eframe::NativeOptions::default();
        eframe::run_native(
            "eframe template",
            native_options,
            Box::new(|cc| Box::new(control_web_apps::TemplateApp::new(cc))),
        );
    }
    
    // when compiling to web using trunk.
    #[cfg(target_arch = "wasm32")]
    fn main() {
        // Make sure panics are logged using `console.error`.
        console_error_panic_hook::set_once();
    
        // Redirect tracing to console.log and friends:
        tracing_wasm::set_as_global_default();
    
        let web_options = eframe::WebOptions::default();
        eframe::start_web(
            "the_canvas_id", // hardcode it
            web_options,
            Box::new(|cc| Box::new(control_web_apps::TemplateApp::new(cc))),
        )
        .expect("failed to start eframe");
    }