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

lints: enable wildcard_imports #368

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ allow_attributes = "deny"
# similar_names = "deny"
# too_many_lines = "deny"
# unreadable_literal = "deny"
# wildcard_imports = "deny"
wildcard_imports = "deny"
# allow_attributes_without_reason = "deny"
# missing_assert_message = "deny"
# missing_docs_in_private_items = "deny"
Expand Down
4 changes: 3 additions & 1 deletion consensus/rules/src/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ use std::collections::HashSet;
use crypto_bigint::{CheckedMul, U256};
use monero_serai::block::Block;

use cuprate_cryptonight::*;
use cuprate_cryptonight::{
cryptonight_hash_r, cryptonight_hash_v0, cryptonight_hash_v1, cryptonight_hash_v2,
};

use crate::{
check_block_version_vote, current_unix_timestamp,
Expand Down
4 changes: 3 additions & 1 deletion helper/src/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ pub fn low_priority_thread() {
#[cfg(target_os = "windows")]
{
use target_os_lib as windows;
use windows::Win32::System::Threading::*;
use windows::Win32::System::Threading::{
GetCurrentThread, SetThreadPriority, THREAD_PRIORITY_IDLE,
};

// SAFETY: calling C.
// We are _lowering_ our priority, not increasing, so this function should never fail.
Expand Down
5 changes: 4 additions & 1 deletion net/epee-encoding/src/container_as_blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use alloc::{string::ToString, vec, vec::Vec};
use bytes::{Buf, BufMut, Bytes, BytesMut};
use ref_cast::RefCast;

use crate::{error::*, EpeeValue, InnerMarker, Marker};
use crate::{
error::{Error, Result},
EpeeValue, InnerMarker, Marker,
};

#[derive(RefCast)]
#[repr(transparent)]
Expand Down
2 changes: 1 addition & 1 deletion net/epee-encoding/src/io.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bytes::{Buf, BufMut};

use crate::error::*;
use crate::error::{Error, Result};

#[inline]
pub(crate) fn checked_read_primitive<B: Buf, R: Sized>(
Expand Down
2 changes: 1 addition & 1 deletion net/epee-encoding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ mod value;
mod varint;

pub use error::*;
use io::*;
use io::{checked_read, checked_read_primitive, checked_write, checked_write_primitive};
pub use marker::{InnerMarker, Marker};
pub use value::EpeeValue;
pub use varint::{read_varint, write_varint};
Expand Down
2 changes: 1 addition & 1 deletion net/epee-encoding/src/varint.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bytes::{Buf, BufMut};

use crate::error::*;
use crate::error::{Error, Result};

const SIZE_OF_SIZE_MARKER: u32 = 2;
const FITS_IN_ONE_BYTE: u64 = 2_u64.pow(8 - SIZE_OF_SIZE_MARKER) - 1;
Expand Down
2 changes: 1 addition & 1 deletion net/wire/src/network_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use bytes::BufMut;
use cuprate_epee_encoding::EpeeObject;

mod epee_builder;
use epee_builder::*;
use epee_builder::TaggedNetworkAddress;

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum NetZone {
Expand Down
10 changes: 8 additions & 2 deletions net/wire/src/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ pub mod admin;
pub mod common;
pub mod protocol;

use admin::*;
use admin::{
HandshakeRequest, HandshakeResponse, PingResponse, SupportFlagsResponse, TimedSyncRequest,
TimedSyncResponse,
};
pub use common::{BasicNodeData, CoreSyncData, PeerListEntryBase};
use protocol::*;
use protocol::{
ChainRequest, ChainResponse, FluffyMissingTransactionsRequest, GetObjectsRequest,
GetObjectsResponse, GetTxPoolCompliment, NewBlock, NewFluffyBlock, NewTransactions,
};

#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum LevinCommand {
Expand Down
2 changes: 1 addition & 1 deletion p2p/address-book/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub async fn init_address_book<Z: BorshNetworkZone>(

use sealed::BorshNetworkZone;
mod sealed {
use super::*;
use super::{NetZoneAddress, NetworkZone};

/// An internal trait for the address book for a [`NetworkZone`] that adds the requirement of [`borsh`] traits
/// onto the network address.
Expand Down
4 changes: 3 additions & 1 deletion p2p/p2p-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ pub mod types;
pub use error::*;
pub use network_zones::{ClearNet, ClearNetServerCfg};
pub use protocol::*;
use services::*;
use services::{
AddressBookRequest, AddressBookResponse, CoreSyncDataRequest, CoreSyncDataResponse,
};
//re-export
pub use cuprate_helper::network::Network;
pub use cuprate_wire::CoreSyncData;
Expand Down
Loading