Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rust 1.75 warnings #372

Merged
merged 2 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions cli/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ pub use crate::notifier::Notification;
pub use crate::result::Result;
pub use crate::utils::*;
pub use async_trait::async_trait;
pub use borsh::{BorshDeserialize, BorshSerialize};
pub use cfg_if::cfg_if;
pub use futures::stream::{Stream, StreamExt, TryStreamExt};
pub use futures::{future::FutureExt, select, Future};
pub use futures::{future::FutureExt, select};
pub use kaspa_consensus_core::network::{NetworkId, NetworkType};
pub use kaspa_daemon::DaemonEvent;
pub use kaspa_utils::hex::*;
pub use kaspa_wallet_core::derivation::gen0::import::*;
pub use kaspa_wallet_core::prelude::*;
Expand All @@ -22,15 +20,12 @@ pub use regex::Regex;
pub use separator::Separatable;
pub use serde::{Deserialize, Serialize};
pub use serde_json::{to_value, Value};
pub use std::cmp;
pub use std::collections::HashMap;
pub use std::collections::VecDeque;
pub use std::ops::Deref;
pub use std::path::{Path, PathBuf};
pub use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
pub use std::sync::{Arc, Mutex, MutexGuard};
pub use std::sync::atomic::{AtomicBool, Ordering};
pub use std::sync::{Arc, Mutex};
pub use workflow_core::prelude::*;
pub use workflow_core::runtime as application_runtime;
pub use workflow_log::*;
pub use workflow_nw::ipc::result::Result as IpcResult;
pub use workflow_terminal::prelude::*;
1 change: 0 additions & 1 deletion consensus/src/processes/transaction_validator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use kaspa_txscript::{
caches::{Cache, TxScriptCacheCounters},
SigCacheKey,
};
pub use tx_validation_in_isolation::*;

#[derive(Clone)]
pub struct TransactionValidator {
Expand Down
1 change: 0 additions & 1 deletion kos/src/core/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#[allow(clippy::module_inception)]
mod core;
pub use self::core::*;
mod ipc;
pub use ipc::*;
mod settings;
Expand Down
14 changes: 7 additions & 7 deletions kos/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ pub enum Error {
Terminal(#[from] workflow_terminal::error::Error),

#[error("channel error")]
RecvError(#[from] workflow_core::channel::RecvError),
Recv(#[from] workflow_core::channel::RecvError),

#[error(transparent)]
CallbackError(#[from] workflow_wasm::callback::CallbackError),
Callback(#[from] workflow_wasm::callback::CallbackError),

#[error("{0}")]
DowncastError(String),
Downcast(String),

#[error("Channel error")]
ChannelError(String),
Channel(String),

#[error(transparent)]
Daemon(#[from] kaspa_daemon::error::Error),

#[error(transparent)]
WalletError(#[from] kaspa_wallet_core::error::Error),
Wallet(#[from] kaspa_wallet_core::error::Error),

#[error(transparent)]
Dom(#[from] workflow_dom::error::Error),
Expand Down Expand Up @@ -96,12 +96,12 @@ impl From<&str> for Error {

impl<T> From<DowncastError<T>> for Error {
fn from(e: DowncastError<T>) -> Self {
Error::DowncastError(e.to_string())
Error::Downcast(e.to_string())
}
}

impl<T> From<ChannelError<T>> for Error {
fn from(e: ChannelError<T>) -> Error {
Error::ChannelError(e.to_string())
Error::Channel(e.to_string())
}
}
16 changes: 4 additions & 12 deletions kos/src/imports.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
pub use crate::core::MetricsCtl;
pub use crate::core::*;
pub use crate::error::Error;
pub use crate::ipc::*;
pub use crate::layout::Layout;
pub use crate::metrics::*;
pub use crate::result::Result;
pub use crate::terminal::*;
pub use async_trait::async_trait;
pub use borsh::{BorshDeserialize, BorshSerialize};
pub use futures::{future::join_all, select, select_biased, stream::StreamExt, FutureExt, Stream};
pub use futures::{select, stream::StreamExt, FutureExt};
pub use kaspa_cli_lib::{KaspaCli, Options as KaspaCliOptions};
pub use kaspa_consensus_core::network::NetworkType;
pub use kaspa_daemon::{
CpuMiner, CpuMinerConfig, CpuMinerCtl, DaemonEvent, DaemonKind, DaemonStatus, Daemons, Kaspad, KaspadConfig, KaspadCtl,
Result as DaemonResult,
};
pub use kaspa_wallet_core::settings::{DefaultSettings, SettingsStore, SettingsStoreT};
pub use nw_sys::prelude::*;
pub use regex::Regex;
pub use serde::{Deserialize, Serialize};
pub use serde_json::{to_value, Value};
pub use std::path::{Path, PathBuf};
pub use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
pub use serde_json::Value;
pub use wasm_bindgen::prelude::*;
pub use workflow_core::channel::*;
pub use workflow_core::enums::Describe;
pub use workflow_core::runtime::*;
pub use workflow_core::task::*;
pub use workflow_core::time::*;
pub use workflow_d3::*;
pub use workflow_log::*;
pub use workflow_nw::ipc::result::Result as IpcResult;
pub use workflow_nw::ipc::*;
pub use workflow_nw::prelude::*;
pub use workflow_terminal::prelude::*;
pub use workflow_terminal::{CrLf, Modifiers, Options as TerminalOptions};
pub use workflow_wasm::callback::{callback, AsCallback, Callback, CallbackMap};
pub use workflow_terminal::{CrLf, Options as TerminalOptions};
pub use workflow_wasm::callback::{callback, AsCallback, CallbackMap};
3 changes: 1 addition & 2 deletions kos/src/metrics/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod ipc;
#[allow(clippy::module_inception)]
mod metrics;
pub use metrics::*;
mod ipc;
pub use ipc::*;
mod settings;
pub use settings::*;
Expand Down
3 changes: 1 addition & 2 deletions kos/src/terminal/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod ipc;
#[allow(clippy::module_inception)]
mod terminal;
pub use terminal::*;
mod ipc;
pub use ipc::*;
mod settings;
pub use settings::*;
2 changes: 1 addition & 1 deletion rpc/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub mod prelude {
}

pub use api::notifications::*;
pub use convert::{block::*, notification::*, tx::*, utxo::*};
pub use convert::utxo::*;
pub use error::*;
pub use model::script_class::*;
pub use model::*;
4 changes: 1 addition & 3 deletions rpc/wrpc/client/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ pub use kaspa_rpc_core::{
api::ops::RpcApiOps,
api::rpc::RpcApi,
error::RpcResult,
notify::{collector::RpcCoreCollector, connection::ChannelConnection, mode::NotificationMode},
notify::{connection::ChannelConnection, mode::NotificationMode},
prelude::*,
};
pub use regex::Regex;
pub use std::sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex,
Expand All @@ -27,7 +26,6 @@ pub use wasm_bindgen::prelude::*;
pub use workflow_core::{
channel::{Channel, DuplexChannel, Receiver},
task::spawn,
trigger::Listener,
};
pub use workflow_log::*;
pub use workflow_rpc::client::prelude::{Encoding as WrpcEncoding, *};
2 changes: 1 addition & 1 deletion rpc/wrpc/proxy/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub enum Error {
WebSocket(#[from] workflow_rpc::server::WebSocketError),

#[error(transparent)]
RpcError(#[from] workflow_rpc::error::Error),
WorkflowRpc(#[from] workflow_rpc::error::Error),
}

impl From<String> for Error {
Expand Down
3 changes: 0 additions & 3 deletions wallet/bip32/src/mnemonic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ mod phrase;
pub(crate) mod seed;

pub use self::{language::Language, phrase::Mnemonic, phrase::WordCount};

//#[cfg(feature = "bip39")]
pub use self::seed::Seed;
12 changes: 4 additions & 8 deletions wallet/core/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! are used internally in the wallet framework core.
//!

pub use crate::account::descriptor::{AccountDescriptor, AccountDescriptorProperty, AccountDescriptorValue};
pub use crate::account::descriptor::{AccountDescriptor, AccountDescriptorProperty};
pub use crate::account::variants::*;
pub use crate::account::{Account, AccountKind, DerivationCapableAccount};
pub use crate::deterministic::*;
Expand All @@ -22,7 +22,7 @@ pub use crate::utxo::balance::Balance;
pub use crate::utxo::scan::{Scan, ScanExtent};
pub use crate::utxo::{Maturity, OutgoingTransaction, UtxoContext, UtxoEntryReference, UtxoProcessor};
pub use crate::wallet::*;
pub use crate::{storage, utils, utxo};
pub use crate::{storage, utils};

pub use ahash::{AHashMap, AHashSet};
pub use async_trait::async_trait;
Expand All @@ -31,13 +31,10 @@ pub use cfg_if::cfg_if;
pub use dashmap::{DashMap, DashSet};
pub use downcast::{downcast_sync, AnySync};
pub use futures::future::join_all;
pub use futures::{select, select_biased, stream, FutureExt, Stream, StreamExt, TryStreamExt};
pub use futures::{select, select_biased, FutureExt, Stream, StreamExt, TryStreamExt};
pub use js_sys::{Array, BigInt, Object};
pub use kaspa_addresses::{Address, Prefix};
pub use kaspa_consensus_core::network::{NetworkId, NetworkType};
pub use kaspa_consensus_core::subnets;
pub use kaspa_consensus_core::subnets::SubnetworkId;
pub use kaspa_consensus_core::tx as cctx;
pub use kaspa_consensus_core::tx::{ScriptPublicKey, TransactionId, TransactionIndexType};
pub use kaspa_utils::hashmap::*;
pub use kaspa_utils::hex::{FromHex, ToHex};
Expand All @@ -48,13 +45,12 @@ pub use std::collections::{HashMap, HashSet};
pub use std::pin::Pin;
pub use std::str::FromStr;
pub use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering};
pub use std::sync::{Arc, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
pub use std::sync::{Arc, Mutex, MutexGuard, RwLock};
pub use std::task::{Context, Poll};
pub use wasm_bindgen::prelude::*;
pub use workflow_core::prelude::*;
pub use workflow_core::seal;
pub use workflow_log::prelude::*;
pub use workflow_wasm::prelude::*;
pub use workflow_wasm::stream::AsyncStream;
pub use xxhash_rust::xxh3::xxh3_64;
pub use zeroize::*;
1 change: 0 additions & 1 deletion wallet/core/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use workflow_core::task::spawn;
pub mod api;
pub mod args;
pub mod maps;
pub use api::*;
pub use args::*;

#[derive(Clone)]
Expand Down