From 14ab9bf4698318402bc382e27d373a153e782403 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 14 Mar 2023 12:42:54 +0100 Subject: [PATCH] make serve work --- Makefile | 3 ++- woweb/src/main.rs | 2 +- woweb/src/ws.rs | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b7184c5..5ce21ac 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,8 @@ check: cargo deny check serve: wasm - cargo run --package woweb + cd woweb; \ + cargo run release: $(DIST_DIR) wasm cargo build --package woweb --release diff --git a/woweb/src/main.rs b/woweb/src/main.rs index 8cacf4e..e4c1814 100644 --- a/woweb/src/main.rs +++ b/woweb/src/main.rs @@ -1,13 +1,13 @@ use axum::routing::get; use axum::Router; use axum_extra::routing::SpaRouter; +use dist_text::text::Text; use std::env; use std::net::SocketAddr; use std::sync::Arc; use tokio::sync::{broadcast, RwLock}; use tower_http::trace::TraceLayer; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; -use dist_text::text::Text; mod ws; diff --git a/woweb/src/ws.rs b/woweb/src/ws.rs index 97d5e15..519e02e 100644 --- a/woweb/src/ws.rs +++ b/woweb/src/ws.rs @@ -9,8 +9,8 @@ use axum::{ response::IntoResponse, }; -use futures::{sink::SinkExt, stream::StreamExt}; use dist_text::crdts::list::Op; +use futures::{sink::SinkExt, stream::StreamExt}; use crate::AppState; @@ -84,6 +84,5 @@ async fn handle_socket(stream: WebSocket, state: Arc) { tokio::select! { _ = (&mut send_task) => recv_task.abort(), _ = (&mut recv_task) => send_task.abort(), - } - ; + }; }