linted extension calls on init function and command index

This commit is contained in:
Valmo Trindade
2024-12-05 03:02:16 -03:00
parent e81104f9eb
commit 972bd1c67e
3 changed files with 10 additions and 12 deletions

View File

@@ -30,7 +30,7 @@ pub fn init() -> Extension {
log4rs::init_config(config).unwrap();
Extension::build()
.group("api", Group::new()
.group("websocket", Group::new()
.command("start", websocket::start)
.command("stop", websocket::stop)
.command("message", websocket::message)
@@ -38,11 +38,11 @@ pub fn init() -> Extension {
)
.command("local_ip", util::get_local_address)
.command("uuid", util::get_uuid)
.command("get_auth_token", api::get_auth_token)
.group(
"markers",
"ots_api",
Group::new()
.command("get", api::markers::get)
.command("get_auth_token", api::get_auth_token)
.command("post", api::markers::post)
.command("post_debug", api::markers::post_debug)
.command("delete", api::markers::delete),

View File

@@ -71,7 +71,6 @@ impl WsServer {
}
}
lazy_static! {
static ref WEBSOCKET_SERVER: Arc<Mutex<Option<WsServer>>> = Arc::new(Mutex::new(None));
}
@@ -101,7 +100,6 @@ pub fn message(payload: String) -> &'static str {
"Sending message to all WebSocket clients"
}
pub fn location(payload: LocationPayload) -> &'static str {
if let Some(ref server) = *WEBSOCKET_SERVER.lock().unwrap() {
server.send_message(payload);