Skip to content

Commit

Permalink
Variable name change hotfix
Browse files Browse the repository at this point in the history
WHo in their right mind reuses var names
  • Loading branch information
Kapsyloffer committed Jan 26, 2024
1 parent 0349f8c commit af76482
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
29 changes: 13 additions & 16 deletions src/api/web_sockets.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
use std::collections::HashMap;

use axum::{
extract::{
ws::{Message, WebSocket, WebSocketUpgrade},
State,
},
response::*,
use axum::
{
extract::{ws::{Message, WebSocket, WebSocketUpgrade},State,},response::*,
};
use serde::{Deserialize, Serialize};
use tokio::sync::broadcast;

use crate::{
use serde::
{
Deserialize, Serialize
};
use crate::
{
api::{game_handling::{check_exists, create_game, fetch_game}, move_handling::*},
rules::{game_board::Color, game_hodler::GameHodler, game_instance::Game},
rules::{game_board::Color, game_hodler::GameHodler},
};

#[derive(Debug, Clone, Deserialize, Serialize)]
Expand Down Expand Up @@ -52,9 +49,9 @@ pub async fn handler(ws: WebSocketUpgrade, State(state): State<GameHodler>) -> R
}

pub async fn handle_socket(mut socket: WebSocket, game_hodler: GameHodler) {
while let Some(msg) = socket.recv().await {
let msg = if let Ok(msg) = msg {
msg
while let Some(m_res) = socket.recv().await {
let msg = if let Ok(m_res) = m_res {
m_res
} else {
println!("Socket ded");
return;
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// use rustbu::api::api_controller::*;
// use rustbu::api::api_gamestate::*;
use axum::{response::*, routing::get, Router};
use axum::{routing::get, Router};
use rustbu::{api::web_sockets::*, rules::game_hodler::GameHodler};

#[tokio::main]
Expand Down

0 comments on commit af76482

Please sign in to comment.