More linting.
This commit is contained in:
1 parent
f4170610b0
commit
feaab2e843
5 files changed
+26
-33
No files matched your search
+4
-11
@@ -24,13 +24,6 @@ use crate::webui::worker::{bob, event_processor_loop};
|
||||
mod views;
|
||||
mod worker;
|
||||
|
||||
struct Service {}
|
||||
|
||||
impl Service {
|
||||
fn get_users(self) -> Vec<String> {
|
||||
vec!["to".to_string(), "foo".to_string()]
|
||||
}
|
||||
}
|
||||
|
||||
struct MiniJinjaRenderer {
|
||||
tmpl_env: web::Data<minijinja_autoreload::AutoReloader>,
|
||||
@@ -84,7 +77,7 @@ fn create_auto_reloader(enable_template_autoreload: bool) -> AutoReloader {
|
||||
|
||||
#[tokio::main]
|
||||
pub async fn web_ui_main(
|
||||
connFact: SQLiteConnectionFactory,
|
||||
conn_fact: SQLiteConnectionFactory,
|
||||
port: u16,
|
||||
enable_template_autoreload: bool,
|
||||
) -> CustomResult<()> {
|
||||
@@ -95,12 +88,12 @@ pub async fn web_ui_main(
|
||||
|
||||
let tmpl_reloader = web::Data::new(tmpl_reloader);
|
||||
|
||||
let clonedConnFact = connFact.clone();
|
||||
let cloned_conn_fact = conn_fact.clone();
|
||||
let server = HttpServer::new(move || {
|
||||
App::new()
|
||||
.app_data(tmpl_reloader.clone())
|
||||
.app_data(web::Data::new(event_sender.clone()))
|
||||
.app_data(web::Data::new(clonedConnFact.clone()))
|
||||
.app_data(web::Data::new(cloned_conn_fact.clone()))
|
||||
.service(
|
||||
actix_files::Files::new("/static", "./resources/static/").use_last_modified(true),
|
||||
)
|
||||
@@ -120,7 +113,7 @@ pub async fn web_ui_main(
|
||||
.unwrap();
|
||||
|
||||
let t1 = server.run().fuse();
|
||||
let t2 = event_processor_loop(connFact, event_receiver).fuse();
|
||||
let t2 = event_processor_loop(conn_fact, event_receiver).fuse();
|
||||
let t3 = bob().fuse();
|
||||
pin_mut!(t1, t2, t3);
|
||||
|
||||
|
||||
Reference in new issue
Block a user