firefly_rust/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)]
#![deny(
    clippy::pedantic,
    clippy::alloc_instead_of_core,
    clippy::allow_attributes,
    clippy::std_instead_of_alloc,
    clippy::std_instead_of_core,
    clippy::expect_used,
    clippy::unwrap_used,
    // missing_docs
)]
#![allow(clippy::wildcard_imports)]
#![expect(
    clippy::struct_excessive_bools,
    clippy::cast_possible_truncation,
    clippy::iter_without_into_iter
)]

pub mod audio;
mod fs;
pub mod graphics;
mod input;
pub mod math;
mod menu;
mod misc;
mod net;
pub mod shapes;
mod stats;
#[cfg(feature = "sudo")]
pub mod sudo;

pub use fs::*;
pub use graphics::*;
pub use input::*;
pub use menu::*;
pub use misc::*;
pub use net::*;
pub use stats::*;

#[cfg(feature = "alloc")]
extern crate alloc;

#[cfg(all(target_family = "wasm", feature = "talc"))]
#[global_allocator]
static ALLOCATOR: talc::TalckWasm = unsafe { talc::TalckWasm::new_global() };

#[cfg(all(not(test), not(feature = "std"), target_family = "wasm"))]
#[panic_handler]
#[allow(unused_variables)]
fn handle_panic(info: &core::panic::PanicInfo) -> ! {
    #[cfg(all(feature = "alloc", feature = "panic_info"))]
    if true {
        let msg = alloc::format!("{info}");
        log_error(&msg);
    }
    core::arch::wasm32::unreachable()
}