Less warnings & Speeeeed!!
This commit is contained in:
parent
af1088e9fb
commit
42cfada4a7
22 changed files with 312 additions and 403 deletions
|
|
@ -2,7 +2,6 @@ use crate::{
|
|||
communities::{community::Community, interactables::interactable::Interactable},
|
||||
data::communication::{CommunicationType, CommunicationValue},
|
||||
};
|
||||
use axum::Json;
|
||||
use json::JsonValue;
|
||||
use std::any::Any;
|
||||
use std::sync::Arc;
|
||||
|
|
@ -96,11 +95,11 @@ impl Interactable for Category {
|
|||
let mut v = JsonValue::new_object();
|
||||
v["children"] = JsonValue::new_array();
|
||||
for child in &self.children {
|
||||
v["children"].push(child.to_json());
|
||||
let _ = v["children"].push(child.to_json());
|
||||
}
|
||||
v
|
||||
}
|
||||
fn load(&mut self, community: Arc<Community>, path: String, name: String, json: &JsonValue) {
|
||||
fn load(&mut self, community: Arc<Community>, path: String, name: String, _json: &JsonValue) {
|
||||
self.community = community;
|
||||
self.name = name;
|
||||
self.path = path;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
use crate::{
|
||||
communities::community::Community,
|
||||
data::communication::{CommunicationType, CommunicationValue},
|
||||
};
|
||||
use axum::Json;
|
||||
use crate::{communities::community::Community, data::communication::CommunicationValue};
|
||||
use json::JsonValue;
|
||||
use std::any::Any;
|
||||
use std::sync::Arc;
|
||||
use std::{any::Any, pin::Pin};
|
||||
|
||||
pub type InteractableFactory = fn() -> Box<dyn Interactable>;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ use crate::communities::interactables::category::Category;
|
|||
use crate::communities::interactables::interactable::{Interactable, InteractableFactory};
|
||||
use crate::communities::interactables::text_chat::TextChat;
|
||||
use crate::communities::interactables::voice_chat::VoiceChat;
|
||||
use crate::gui::log_panel;
|
||||
use crate::util::file_util;
|
||||
use json::JsonValue;
|
||||
use once_cell::sync::Lazy;
|
||||
|
|
|
|||
|
|
@ -7,16 +7,10 @@ use crate::{
|
|||
gui::log_panel::log_message,
|
||||
util::file_util::{get_children, load_file, save_file},
|
||||
};
|
||||
use aes_gcm::aead::Payload;
|
||||
use axum::Json;
|
||||
use json::{JsonValue, array, object};
|
||||
use rustls::ClientConnection;
|
||||
use std::sync::Arc;
|
||||
use std::{any::Any, collections::HashMap};
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
pin::Pin,
|
||||
};
|
||||
use std::{fs, pin::Pin};
|
||||
use uuid::Uuid;
|
||||
pub struct TextChat {
|
||||
name: String,
|
||||
|
|
@ -190,7 +184,7 @@ impl Interactable for TextChat {
|
|||
JsonValue::new_object()
|
||||
}
|
||||
fn run_function(&self, cv: CommunicationValue) -> CommunicationValue {
|
||||
let ret: Pin<Box<dyn Future<Output = CommunicationValue> + Send>> = Box::pin(async move {
|
||||
let _: Pin<Box<dyn Future<Output = CommunicationValue> + Send>> = Box::pin(async move {
|
||||
let payload = cv.get_data(DataTypes::payload).unwrap();
|
||||
if cv.get_data(DataTypes::function).unwrap().as_str().unwrap() == "get_messages" {
|
||||
let amount = payload["amount"].as_i64().unwrap();
|
||||
|
|
@ -247,10 +241,9 @@ impl Interactable for TextChat {
|
|||
CommunicationValue::new(CommunicationType::error)
|
||||
}
|
||||
fn to_json(&self) -> JsonValue {
|
||||
let mut v = JsonValue::new_object();
|
||||
v
|
||||
JsonValue::new_object()
|
||||
}
|
||||
fn load(&mut self, community: Arc<Community>, path: String, name: String, json: &JsonValue) {
|
||||
fn load(&mut self, community: Arc<Community>, path: String, name: String, _: &JsonValue) {
|
||||
self.community = community;
|
||||
self.name = name;
|
||||
self.path = path;
|
||||
|
|
|
|||
|
|
@ -72,10 +72,10 @@ impl Interactable for VoiceChat {
|
|||
CommunicationValue::new(CommunicationType::error)
|
||||
}
|
||||
fn to_json(&self) -> JsonValue {
|
||||
let mut v = JsonValue::new_object();
|
||||
let v = JsonValue::new_object();
|
||||
v
|
||||
}
|
||||
fn load(&mut self, community: Arc<Community>, path: String, name: String, json: &JsonValue) {
|
||||
fn load(&mut self, community: Arc<Community>, path: String, name: String, _json: &JsonValue) {
|
||||
self.community = community;
|
||||
self.name = name;
|
||||
self.path = path;
|
||||
|
|
|
|||
Loading…
Reference in a new issue