rename main -> notedeck

This commit is contained in:
William Casarin
2023-09-30 20:46:47 -07:00
parent f425f72fd1
commit 596a8030d1

42
src/bin/notedeck.rs Normal file
View File

@@ -0,0 +1,42 @@
#![warn(clippy::all, rust_2018_idioms)]
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
use damus::Damus;
// Entry point for wasm
//#[cfg(target_arch = "wasm32")]
//use wasm_bindgen::prelude::*;
// Desktop
#[cfg(not(target_arch = "wasm32"))]
#[tokio::main]
async fn main() {
// Log to stdout (if you run with `RUST_LOG=debug`).
tracing_subscriber::fmt::init();
let native_options = eframe::NativeOptions::default();
let _res = eframe::run_native(
"Damus NoteDeck",
native_options,
Box::new(|_cc| Box::new(Damus::new())),
);
}
#[cfg(target_arch = "wasm32")]
pub 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();
wasm_bindgen_futures::spawn_local(async {
let web_options = eframe::WebOptions::default();
eframe::start_web(
"the_canvas_id", // hardcode it
web_options,
Box::new(|_cc| Box::new(Damus::new())),
)
.await
.expect("failed to start eframe");
});
}