mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2024-11-30 04:45:26 +00:00
Clean up mod and use statements in lib.rs and main.rs
This commit is contained in:
parent
b2ffc4e496
commit
13a48c4577
10
src/lib.rs
10
src/lib.rs
|
@ -7,21 +7,23 @@
|
||||||
#![allow(clippy::suspicious_else_formatting)]
|
#![allow(clippy::suspicious_else_formatting)]
|
||||||
#![deny(clippy::dbg_macro)]
|
#![deny(clippy::dbg_macro)]
|
||||||
|
|
||||||
pub mod appservice_server;
|
use std::ops::Deref;
|
||||||
pub mod client_server;
|
|
||||||
mod database;
|
mod database;
|
||||||
mod error;
|
mod error;
|
||||||
mod pdu;
|
mod pdu;
|
||||||
mod ruma_wrapper;
|
mod ruma_wrapper;
|
||||||
pub mod server_server;
|
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
|
pub mod appservice_server;
|
||||||
|
pub mod client_server;
|
||||||
|
pub mod server_server;
|
||||||
|
|
||||||
pub use database::{Config, Database};
|
pub use database::{Config, Database};
|
||||||
pub use error::{Error, Result};
|
pub use error::{Error, Result};
|
||||||
pub use pdu::PduEvent;
|
pub use pdu::PduEvent;
|
||||||
pub use rocket::Config as RocketConfig;
|
pub use rocket::Config as RocketConfig;
|
||||||
pub use ruma_wrapper::{ConduitResult, Ruma, RumaResponse};
|
pub use ruma_wrapper::{ConduitResult, Ruma, RumaResponse};
|
||||||
use std::ops::Deref;
|
|
||||||
|
|
||||||
pub struct State<'r, T: Send + Sync + 'static>(pub &'r T);
|
pub struct State<'r, T: Send + Sync + 'static>(pub &'r T);
|
||||||
|
|
||||||
|
|
22
src/main.rs
22
src/main.rs
|
@ -7,27 +7,9 @@
|
||||||
#![allow(clippy::suspicious_else_formatting)]
|
#![allow(clippy::suspicious_else_formatting)]
|
||||||
#![deny(clippy::dbg_macro)]
|
#![deny(clippy::dbg_macro)]
|
||||||
|
|
||||||
pub mod appservice_server;
|
|
||||||
pub mod client_server;
|
|
||||||
pub mod server_server;
|
|
||||||
|
|
||||||
mod database;
|
|
||||||
mod error;
|
|
||||||
mod pdu;
|
|
||||||
mod ruma_wrapper;
|
|
||||||
mod utils;
|
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use database::Config;
|
|
||||||
pub use database::Database;
|
|
||||||
pub use error::{Error, Result};
|
|
||||||
use opentelemetry::trace::{FutureExt, Tracer};
|
use opentelemetry::trace::{FutureExt, Tracer};
|
||||||
pub use pdu::PduEvent;
|
|
||||||
pub use rocket::State;
|
|
||||||
use ruma::api::client::error::ErrorKind;
|
|
||||||
pub use ruma_wrapper::{ConduitResult, Ruma, RumaResponse};
|
|
||||||
|
|
||||||
use rocket::{
|
use rocket::{
|
||||||
catch, catchers,
|
catch, catchers,
|
||||||
figment::{
|
figment::{
|
||||||
|
@ -36,9 +18,13 @@ use rocket::{
|
||||||
},
|
},
|
||||||
routes, Request,
|
routes, Request,
|
||||||
};
|
};
|
||||||
|
use ruma::api::client::error::ErrorKind;
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
use tracing_subscriber::{prelude::*, EnvFilter};
|
use tracing_subscriber::{prelude::*, EnvFilter};
|
||||||
|
|
||||||
|
pub use conduit::*; // Re-export everything from the library crate
|
||||||
|
pub use rocket::State;
|
||||||
|
|
||||||
fn setup_rocket(config: Figment, data: Arc<RwLock<Database>>) -> rocket::Rocket<rocket::Build> {
|
fn setup_rocket(config: Figment, data: Arc<RwLock<Database>>) -> rocket::Rocket<rocket::Build> {
|
||||||
rocket::custom(config)
|
rocket::custom(config)
|
||||||
.manage(data)
|
.manage(data)
|
||||||
|
|
Loading…
Reference in a new issue