Using .env config

This commit is contained in:
2025-10-31 15:45:20 +01:00
parent 178adf8bf5
commit 7ed85f30dc
3 changed files with 10 additions and 10 deletions
+4 -8
View File
@@ -2,7 +2,6 @@ use std::{
collections::HashSet,
net::{TcpListener, TcpStream},
path::{Path, PathBuf},
str::FromStr,
sync::{Arc, Mutex},
};
@@ -52,6 +51,10 @@ impl ServerConfig {
pub fn build(self, root: &Path) -> Arc<Server> {
Server::new_config(root, self)
}
pub fn from_str(s: &str) -> std::result::Result<Self, serde_json::Error> {
serde_json::from_str(s)
}
}
impl Server {
@@ -207,10 +210,3 @@ impl Server {
res
}
}
impl FromStr for ServerConfig {
type Err = serde_json::Error;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
serde_json::from_str(s)
}
}