mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 20:43:30 +00:00
linted extension calls on init function and command index
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user