Added allows for unused things.
This commit is contained in:
parent
77e5072f20
commit
39b6351c85
7 changed files with 11 additions and 11 deletions
|
|
@ -26,6 +26,7 @@ pub enum UserChoice {
|
||||||
AcceptAll,
|
AcceptAll,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)] // ui is unused
|
||||||
pub struct TermsCheckerScreen {
|
pub struct TermsCheckerScreen {
|
||||||
ui: Arc<UI>,
|
ui: Arc<UI>,
|
||||||
sender: Option<oneshot::Sender<UserChoice>>,
|
sender: Option<oneshot::Sender<UserChoice>>,
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,7 @@ use ratatui::{Terminal, backend::CrosstermBackend, init};
|
||||||
use std::{
|
use std::{
|
||||||
collections::VecDeque,
|
collections::VecDeque,
|
||||||
io::Stdout,
|
io::Stdout,
|
||||||
sync::{
|
sync::{Arc, Mutex, atomic::Ordering},
|
||||||
Arc, Mutex,
|
|
||||||
atomic::{AtomicBool, Ordering},
|
|
||||||
},
|
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
use tokio::{sync::RwLock, time::Instant};
|
use tokio::{sync::RwLock, time::Instant};
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ use iota_util::file_util::{download_and_extract_zip, has_dir};
|
||||||
use omikron_connector as omikron;
|
use omikron_connector as omikron;
|
||||||
|
|
||||||
#[tokio::main(flavor = "multi_thread", worker_threads = 16)]
|
#[tokio::main(flavor = "multi_thread", worker_threads = 16)]
|
||||||
#[allow(unused_must_use, dead_code)]
|
#[allow(unused_must_use, dead_code, unused_assignments)]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
while *RELOAD.read().await {
|
while *RELOAD.read().await {
|
||||||
*RELOAD.write().await = false;
|
*RELOAD.write().await = false;
|
||||||
|
|
@ -107,7 +107,9 @@ async fn main() {
|
||||||
sb1 = sb1 + ",";
|
sb1 = sb1 + ",";
|
||||||
}
|
}
|
||||||
log!("Community IDS: {}", sb1); */
|
log!("Community IDS: {}", sb1); */
|
||||||
|
#[allow(unused_variables)] // port is unused
|
||||||
let port = CONFIG.read().await.get_port();
|
let port = CONFIG.read().await.get_port();
|
||||||
|
#[allow(unused_variables)] // ip is unused
|
||||||
let mut ip = "0.0.0.0".to_string();
|
let mut ip = "0.0.0.0".to_string();
|
||||||
for iface in pnet::datalink::interfaces() {
|
for iface in pnet::datalink::interfaces() {
|
||||||
let iface: NetworkInterface = iface;
|
let iface: NetworkInterface = iface;
|
||||||
|
|
@ -115,7 +117,7 @@ async fn main() {
|
||||||
let ipsv = format!("{}", iface.ips[0]);
|
let ipsv = format!("{}", iface.ips[0]);
|
||||||
let ips: &str = ipsv.split('/').next().unwrap_or("");
|
let ips: &str = ipsv.split('/').next().unwrap_or("");
|
||||||
if format!("{}", ips).starts_with("10.") || format!("{}", ips).starts_with("192.") {
|
if format!("{}", ips).starts_with("10.") || format!("{}", ips).starts_with("192.") {
|
||||||
ip = ips.to_string();
|
ip = ips.to_string(); // Unused assignments.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ use anyhow::{Context, Result, anyhow};
|
||||||
use iota_logger::log;
|
use iota_logger::log;
|
||||||
use self_replace::self_replace;
|
use self_replace::self_replace;
|
||||||
use semver::Version;
|
use semver::Version;
|
||||||
use std::fs::File;
|
|
||||||
use tempfile::NamedTempFile;
|
use tempfile::NamedTempFile;
|
||||||
|
|
||||||
const CURRENT_VERSION: &str = env!("CARGO_PKG_VERSION");
|
const CURRENT_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
|
@ -108,7 +107,6 @@ async fn download_asset(url: &str) -> Result<NamedTempFile> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let tmp = NamedTempFile::new().context("failed to create temp file")?;
|
let tmp = NamedTempFile::new().context("failed to create temp file")?;
|
||||||
let mut out = File::create(tmp.path()).context("failed to open temp file")?;
|
|
||||||
|
|
||||||
let bytes = response
|
let bytes = response
|
||||||
.bytes()
|
.bytes()
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ impl ConnectionState {
|
||||||
// Omikron Connection (Client-side with auto-reconnect)
|
// Omikron Connection (Client-side with auto-reconnect)
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
#[allow(dead_code)] // message_send_times is unused.
|
||||||
pub struct OmikronConnection {
|
pub struct OmikronConnection {
|
||||||
state: Arc<RwLock<ConnectionState>>,
|
state: Arc<RwLock<ConnectionState>>,
|
||||||
sender: Arc<RwLock<Option<Arc<Sender>>>>,
|
sender: Arc<RwLock<Option<Arc<Sender>>>>,
|
||||||
|
|
@ -283,6 +284,7 @@ impl OmikronConnection {
|
||||||
if iota_id == 0 {
|
if iota_id == 0 {
|
||||||
log_t!("iota_register_new");
|
log_t!("iota_register_new");
|
||||||
|
|
||||||
|
#[allow(unused_variables)] // priv_k is unused
|
||||||
let (pub_k, priv_k) = if let (Some(pk), Some(sk)) = (public_key, private_key) {
|
let (pub_k, priv_k) = if let (Some(pk), Some(sk)) = (public_key, private_key) {
|
||||||
(pk, sk)
|
(pk, sk)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -426,9 +428,10 @@ impl OmikronConnection {
|
||||||
|
|
||||||
if cv.is_type(CommunicationType::client_connected) {
|
if cv.is_type(CommunicationType::client_connected) {
|
||||||
let user_id = cv.get_data(DataTypes::user_id).as_number().unwrap_or(0) as i64;
|
let user_id = cv.get_data(DataTypes::user_id).as_number().unwrap_or(0) as i64;
|
||||||
|
#[allow(unused_variables)] // session_id is unused.
|
||||||
let session_id = cv.get_data(DataTypes::session_id).as_number().unwrap_or(0) as i64;
|
let session_id = cv.get_data(DataTypes::session_id).as_number().unwrap_or(0) as i64;
|
||||||
|
|
||||||
let mut contacts = chats_util::get_users(user_id);
|
let contacts = chats_util::get_users(user_id);
|
||||||
let mut contacts_array = Vec::new();
|
let mut contacts_array = Vec::new();
|
||||||
|
|
||||||
for (i, contact) in contacts.iter().enumerate() {
|
for (i, contact) in contacts.iter().enumerate() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
use crate::omikron_connection::OmikronConnection;
|
use crate::omikron_connection::OmikronConnection;
|
||||||
use dashmap::DashMap;
|
use dashmap::DashMap;
|
||||||
use iota_logger::log;
|
|
||||||
use iota_state::APP_STATE;
|
use iota_state::APP_STATE;
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ async fn communities_get(req: HttpRequest, ssl: web::Data<bool>) -> impl Respond
|
||||||
async fn communities_add(
|
async fn communities_add(
|
||||||
req: HttpRequest,
|
req: HttpRequest,
|
||||||
ssl: web::Data<bool>,
|
ssl: web::Data<bool>,
|
||||||
payload: web::Json<Value>,
|
#[allow(unused_variables)] payload: web::Json<Value>,
|
||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
if !is_allowed_req(&req, *ssl.get_ref()) {
|
if !is_allowed_req(&req, *ssl.get_ref()) {
|
||||||
return forbidden();
|
return forbidden();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue