mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-26 19:46:36 +02:00
this project's codebase is so horrendous, im shocked that no one has ran clippy at all. it had ~200 total lint warnings, some with performance issues and unsoundness, and the rest just very ugly codebase. i have sat down and fixed as many of these as possible and i am exhausted. i haven't fixed some extremely complex ones, but i brought it down from ~200 to ~30. i have also removed io_uring as a default feature due to it falling under the same category as linux eBPF: major kernel attack surface for minimal performance gains. this also makes it impossible to cross-compile from macOS to Linux because io_uring does not exist in Darwin land. there are far better ways to achieve better performance than io_uring on the codebase level. Signed-off-by: strawberry <june@girlboss.ceo>
30 lines
672 B
Rust
30 lines
672 B
Rust
#![warn(
|
|
rust_2018_idioms,
|
|
unused_qualifications,
|
|
clippy::cloned_instead_of_copied,
|
|
clippy::str_to_string
|
|
)]
|
|
#![deny(clippy::dbg_macro)]
|
|
|
|
pub mod api;
|
|
mod config;
|
|
mod database;
|
|
mod service;
|
|
mod utils;
|
|
|
|
use std::sync::RwLock;
|
|
|
|
pub use api::ruma_wrapper::{Ruma, RumaResponse};
|
|
pub use config::Config;
|
|
pub use database::KeyValueDatabase;
|
|
pub use service::{pdu::PduEvent, Services};
|
|
pub use utils::error::{Error, Result};
|
|
|
|
pub static SERVICES: RwLock<Option<&'static Services>> = RwLock::new(None);
|
|
|
|
pub fn services() -> &'static Services {
|
|
SERVICES
|
|
.read()
|
|
.unwrap()
|
|
.expect("SERVICES should be initialized when this is called")
|
|
}
|