run-highlighter/src/lib.rs

29 lines
949 B
Rust
Executable File

#![feature(try_blocks, async_closure)]
#![forbid(unsafe_code)]
#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds
#![warn(clippy::all, rust_2018_idioms)]
#[cfg(target_arch = "wasm32")]
use eframe::wasm_bindgen::{self, prelude::*};
pub use crate::app::App;
mod app;
mod config;
mod splits_logic;
// ----------------------------------------------------------------------------
// When compiling for web:
/// This is the entry-point for all the web-assembly.
/// This is called once from the HTML.
/// It loads the app, installs some callbacks, then returns.
/// You can add more callbacks like this if you want to call in to your code.
#[cfg(target_arch = "wasm32")]
#[wasm_bindgen]
pub fn start(canvas_id: &str) -> Result<(), eframe::wasm_bindgen::JsValue> {
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
let app = App::default();
eframe::start_web(canvas_id, Box::new(app))
}