From 889fde4636cca634fde8ade5912c5b980d62b263336dc3c582b147c58d9e3874 Mon Sep 17 00:00:00 2001 From: raven <7156279+RavenX8@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:17:27 -0500 Subject: [PATCH] - add: missing call to dotenv - remove: unreachable code in route_packet --- packet-service/src/main.rs | 2 ++ packet-service/src/router.rs | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packet-service/src/main.rs b/packet-service/src/main.rs index 3e2be88..850b81c 100644 --- a/packet-service/src/main.rs +++ b/packet-service/src/main.rs @@ -1,5 +1,6 @@ use std::env; use std::str::FromStr; +use dotenv::dotenv; use tokio::net::TcpListener; use tokio::io::{AsyncReadExt}; use tracing::{info, error}; @@ -10,6 +11,7 @@ mod router; #[tokio::main] async fn main() -> Result<(), Box> { + dotenv().ok(); tracing_subscriber::fmt() .with_max_level(Level::from_str(&env::var("LOG_LEVEL").unwrap_or_else(|_| "info".to_string())).unwrap_or_else(|_| Level::INFO)) .init(); diff --git a/packet-service/src/router.rs b/packet-service/src/router.rs index c2c138d..633a2ea 100644 --- a/packet-service/src/router.rs +++ b/packet-service/src/router.rs @@ -10,6 +10,4 @@ pub async fn route_packet(data: &[u8]) -> Result<(), Box> { // 2 => movement::handle_movement(packet).await?, _ => return Err("Unknown packet type".into()), } - - Ok(()) }