From 5648bf0da0ed2719e6987425138e89957508df4c Mon Sep 17 00:00:00 2001 From: hinto-janai Date: Tue, 20 Aug 2024 18:50:31 -0400 Subject: [PATCH] rpc: remove temporary lints (#255) * rpc: remove temporary lints for types * rpc: remove temporary lints for json-rpc * rpc: remove temporary lints for interface * cfgs `1 tab` -> `4 spaces` --- rpc/interface/src/lib.rs | 103 +++++++++++------------- rpc/interface/src/route/bin.rs | 2 +- rpc/interface/src/router_builder.rs | 7 +- rpc/interface/src/rpc_error.rs | 2 +- rpc/interface/src/rpc_handler.rs | 8 +- rpc/interface/src/rpc_handler_dummy.rs | 5 +- rpc/json-rpc/src/lib.rs | 90 +++++++++++---------- rpc/types/src/bin.rs | 15 ++-- rpc/types/src/defaults.rs | 7 -- rpc/types/src/free.rs | 2 + rpc/types/src/json.rs | 5 +- rpc/types/src/lib.rs | 105 +++++++++++-------------- rpc/types/src/misc/distribution.rs | 15 ++-- rpc/types/src/misc/misc.rs | 12 +-- rpc/types/src/misc/tx_entry.rs | 8 +- rpc/types/src/other.rs | 7 +- rpc/types/src/serde.rs | 2 +- storage/blockchain/src/lib.rs | 90 ++++++++++----------- storage/database/src/lib.rs | 92 +++++++++++----------- 19 files changed, 255 insertions(+), 322 deletions(-) diff --git a/rpc/interface/src/lib.rs b/rpc/interface/src/lib.rs index 2656b07..43bd9e1 100644 --- a/rpc/interface/src/lib.rs +++ b/rpc/interface/src/lib.rs @@ -4,37 +4,37 @@ // Forbid lints. // Our code, and code generated (e.g macros) cannot overrule these. #![forbid( - // `unsafe` is allowed but it _must_ be - // commented with `SAFETY: reason`. - clippy::undocumented_unsafe_blocks, + // `unsafe` is allowed but it _must_ be + // commented with `SAFETY: reason`. + clippy::undocumented_unsafe_blocks, - // Never. - unused_unsafe, - redundant_semicolons, - unused_allocation, - coherence_leak_check, - while_true, + // Never. + unused_unsafe, + redundant_semicolons, + unused_allocation, + coherence_leak_check, + while_true, - // Maybe can be put into `#[deny]`. - unconditional_recursion, - for_loops_over_fallibles, - unused_braces, - unused_labels, - keyword_idents, - non_ascii_idents, - variant_size_differences, + // Maybe can be put into `#[deny]`. + unconditional_recursion, + for_loops_over_fallibles, + unused_braces, + unused_labels, + keyword_idents, + non_ascii_idents, + variant_size_differences, single_use_lifetimes, - // Probably can be put into `#[deny]`. - future_incompatible, - let_underscore, - break_with_label_and_loop, - duplicate_macro_attributes, - exported_private_dependencies, - large_assignments, - overlapping_range_endpoints, - semicolon_in_expressions_from_macros, - noop_method_call, + // Probably can be put into `#[deny]`. + future_incompatible, + let_underscore, + break_with_label_and_loop, + duplicate_macro_attributes, + exported_private_dependencies, + large_assignments, + overlapping_range_endpoints, + semicolon_in_expressions_from_macros, + noop_method_call, )] // Deny lints. // Some of these are `#[allow]`'ed on a per-case basis. @@ -57,39 +57,30 @@ unreachable_pub )] #![allow( - // FIXME: this lint affects crates outside of - // `database/` for some reason, allow for now. - clippy::cargo_common_metadata, + // FIXME: this lint affects crates outside of + // `database/` for some reason, allow for now. + clippy::cargo_common_metadata, - // FIXME: adding `#[must_use]` onto everything - // might just be more annoying than useful... - // although it is sometimes nice. - clippy::must_use_candidate, + // FIXME: adding `#[must_use]` onto everything + // might just be more annoying than useful... + // although it is sometimes nice. + clippy::must_use_candidate, - // FIXME: good lint but too many false positives - // with our `Env` + `RwLock` setup. - clippy::significant_drop_tightening, + // FIXME: good lint but too many false positives + // with our `Env` + `RwLock` setup. + clippy::significant_drop_tightening, - // FIXME: good lint but is less clear in most cases. - clippy::items_after_statements, + // FIXME: good lint but is less clear in most cases. + clippy::items_after_statements, - // TODO - rustdoc::bare_urls, + // TODO + rustdoc::bare_urls, - clippy::module_name_repetitions, - clippy::module_inception, - clippy::redundant_pub_crate, - clippy::option_if_let_else, -)] -// Allow some lints when running in debug mode. -#![cfg_attr( - debug_assertions, - allow( - clippy::todo, - clippy::multiple_crate_versions, - unused_imports, - unused_variables - ) + clippy::multiple_crate_versions, + clippy::module_name_repetitions, + clippy::module_inception, + clippy::redundant_pub_crate, + clippy::option_if_let_else, )] // Allow some lints in tests. #![cfg_attr( @@ -101,8 +92,6 @@ clippy::too_many_lines ) )] -// TODO: remove me after finishing impl -#![allow(dead_code, unreachable_code, clippy::diverging_sub_expression)] //---------------------------------------------------------------------------------------------------- Mod mod route; diff --git a/rpc/interface/src/route/bin.rs b/rpc/interface/src/route/bin.rs index b17b98c..942e091 100644 --- a/rpc/interface/src/route/bin.rs +++ b/rpc/interface/src/route/bin.rs @@ -81,7 +81,7 @@ macro_rules! generate_endpoints_inner { // Serialize to bytes and respond. match cuprate_epee_encoding::to_bytes(response) { Ok(bytes) => Ok(bytes.freeze()), - Err(e) => Err(StatusCode::INTERNAL_SERVER_ERROR), + Err(_) => Err(StatusCode::INTERNAL_SERVER_ERROR), } } } diff --git a/rpc/interface/src/router_builder.rs b/rpc/interface/src/router_builder.rs index d370cf4..2e80c43 100644 --- a/rpc/interface/src/router_builder.rs +++ b/rpc/interface/src/router_builder.rs @@ -1,12 +1,7 @@ //! Free functions. -use std::marker::PhantomData; - //---------------------------------------------------------------------------------------------------- Use -use axum::{ - routing::{method_routing::get, post}, - Router, -}; +use axum::Router; use crate::{ route::{bin, fallback, json_rpc, other}, diff --git a/rpc/interface/src/rpc_error.rs b/rpc/interface/src/rpc_error.rs index 92b9cc1..47563d6 100644 --- a/rpc/interface/src/rpc_error.rs +++ b/rpc/interface/src/rpc_error.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; pub enum RpcError {} impl From for StatusCode { - fn from(value: RpcError) -> Self { + fn from(_: RpcError) -> Self { // TODO Self::INTERNAL_SERVER_ERROR } diff --git a/rpc/interface/src/rpc_handler.rs b/rpc/interface/src/rpc_handler.rs index 3d1c28d..bcd0873 100644 --- a/rpc/interface/src/rpc_handler.rs +++ b/rpc/interface/src/rpc_handler.rs @@ -1,16 +1,10 @@ //! RPC handler trait. //---------------------------------------------------------------------------------------------------- Use -use std::{future::Future, task::Poll}; +use std::future::Future; -use axum::{http::StatusCode, response::IntoResponse}; -use futures::{channel::oneshot::channel, FutureExt}; use tower::Service; -use cuprate_helper::asynch::InfallibleOneshotReceiver; -use cuprate_json_rpc::Id; -use cuprate_rpc_types::json::JsonRpcRequest; - use crate::{rpc_error::RpcError, rpc_request::RpcRequest, rpc_response::RpcResponse}; //---------------------------------------------------------------------------------------------------- RpcHandler diff --git a/rpc/interface/src/rpc_handler_dummy.rs b/rpc/interface/src/rpc_handler_dummy.rs index 97b7585..73ffe9c 100644 --- a/rpc/interface/src/rpc_handler_dummy.rs +++ b/rpc/interface/src/rpc_handler_dummy.rs @@ -3,14 +3,13 @@ //---------------------------------------------------------------------------------------------------- Use use std::task::Poll; -use futures::{channel::oneshot::channel, FutureExt}; +use futures::channel::oneshot::channel; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use tower::Service; use cuprate_helper::asynch::InfallibleOneshotReceiver; use cuprate_json_rpc::Id; -use cuprate_rpc_types::json::JsonRpcRequest; use crate::{ rpc_error::RpcError, rpc_handler::RpcHandler, rpc_request::RpcRequest, @@ -48,7 +47,7 @@ impl Service for RpcHandlerDummy { type Error = RpcError; type Future = InfallibleOneshotReceiver>; - fn poll_ready(&mut self, cx: &mut std::task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _: &mut std::task::Context<'_>) -> Poll> { Poll::Ready(Ok(())) } diff --git a/rpc/json-rpc/src/lib.rs b/rpc/json-rpc/src/lib.rs index 45ac2ef..ce7467a 100644 --- a/rpc/json-rpc/src/lib.rs +++ b/rpc/json-rpc/src/lib.rs @@ -3,38 +3,38 @@ // Forbid lints. // Our code, and code generated (e.g macros) cannot overrule these. #![forbid( - // `unsafe` is allowed but it _must_ be - // commented with `SAFETY: reason`. - clippy::undocumented_unsafe_blocks, + // `unsafe` is allowed but it _must_ be + // commented with `SAFETY: reason`. + clippy::undocumented_unsafe_blocks, - // Never. - unused_unsafe, - redundant_semicolons, - unused_allocation, - coherence_leak_check, - while_true, + // Never. + unused_unsafe, + redundant_semicolons, + unused_allocation, + coherence_leak_check, + while_true, - // Maybe can be put into `#[deny]`. - unconditional_recursion, - for_loops_over_fallibles, - unused_braces, - unused_labels, - keyword_idents, - non_ascii_idents, - variant_size_differences, + // Maybe can be put into `#[deny]`. + unconditional_recursion, + for_loops_over_fallibles, + unused_braces, + unused_labels, + keyword_idents, + non_ascii_idents, + variant_size_differences, single_use_lifetimes, - // Probably can be put into `#[deny]`. - future_incompatible, - let_underscore, - break_with_label_and_loop, - duplicate_macro_attributes, - exported_private_dependencies, - large_assignments, - overlapping_range_endpoints, - semicolon_in_expressions_from_macros, - noop_method_call, - unreachable_pub, + // Probably can be put into `#[deny]`. + future_incompatible, + let_underscore, + break_with_label_and_loop, + duplicate_macro_attributes, + exported_private_dependencies, + large_assignments, + overlapping_range_endpoints, + semicolon_in_expressions_from_macros, + noop_method_call, + unreachable_pub, )] // Deny lints. // Some of these are `#[allow]`'ed on a per-case basis. @@ -56,29 +56,27 @@ nonstandard_style )] #![allow( - // FIXME: this lint affects crates outside of - // `database/` for some reason, allow for now. - clippy::cargo_common_metadata, + // FIXME: this lint affects crates outside of + // `database/` for some reason, allow for now. + clippy::cargo_common_metadata, - // FIXME: adding `#[must_use]` onto everything - // might just be more annoying than useful... - // although it is sometimes nice. - clippy::must_use_candidate, + // FIXME: adding `#[must_use]` onto everything + // might just be more annoying than useful... + // although it is sometimes nice. + clippy::must_use_candidate, - // FIXME: good lint but too many false positives - // with our `Env` + `RwLock` setup. - clippy::significant_drop_tightening, + // FIXME: good lint but too many false positives + // with our `Env` + `RwLock` setup. + clippy::significant_drop_tightening, - // FIXME: good lint but is less clear in most cases. - clippy::items_after_statements, + // FIXME: good lint but is less clear in most cases. + clippy::items_after_statements, - clippy::module_name_repetitions, - clippy::module_inception, - clippy::redundant_pub_crate, - clippy::option_if_let_else, + clippy::module_name_repetitions, + clippy::module_inception, + clippy::redundant_pub_crate, + clippy::option_if_let_else, )] -// Allow some lints when running in debug mode. -#![cfg_attr(debug_assertions, allow(clippy::todo, clippy::multiple_crate_versions))] // Allow some lints in tests. #![cfg_attr( test, diff --git a/rpc/types/src/bin.rs b/rpc/types/src/bin.rs index 278e535..0dbddea 100644 --- a/rpc/types/src/bin.rs +++ b/rpc/types/src/bin.rs @@ -13,22 +13,17 @@ use cuprate_epee_encoding::{ container_as_blob::ContainerAsBlob, epee_object, error, macros::bytes::{Buf, BufMut}, - read_epee_value, write_field, EpeeObject, EpeeObjectBuilder, EpeeValue, + read_epee_value, write_field, EpeeObject, EpeeObjectBuilder, }; use cuprate_types::BlockCompleteEntry; use crate::{ - base::{AccessResponseBase, ResponseBase}, - defaults::{default_false, default_height, default_string, default_vec, default_zero}, - free::{is_one, is_zero}, + base::AccessResponseBase, + defaults::{default_false, default_zero}, macros::{define_request, define_request_and_response, define_request_and_response_doc}, - misc::{ - AuxPow, BlockHeader, BlockOutputIndices, ChainInfo, ConnectionInfo, GetBan, GetOutputsOut, - HardforkEntry, HistogramEntry, OutKeyBin, OutputDistributionData, Peer, PoolInfoExtent, - PoolTxInfo, SetBan, Span, Status, TxBacklogEntry, - }, - rpc_call::{RpcCall, RpcCallValue}, + misc::{BlockOutputIndices, GetOutputsOut, OutKeyBin, PoolInfoExtent, PoolTxInfo, Status}, + rpc_call::RpcCallValue, }; //---------------------------------------------------------------------------------------------------- Definitions diff --git a/rpc/types/src/defaults.rs b/rpc/types/src/defaults.rs index 6addd0a..def5df4 100644 --- a/rpc/types/src/defaults.rs +++ b/rpc/types/src/defaults.rs @@ -8,7 +8,6 @@ //! `height`, it will use [`default_height`] to fill that in. //---------------------------------------------------------------------------------------------------- Import -use std::borrow::Cow; //---------------------------------------------------------------------------------------------------- TODO /// Default [`bool`] type used in request/response types, `false`. @@ -23,12 +22,6 @@ pub(crate) const fn default_true() -> bool { true } -/// Default `Cow<'static, str` type used in request/response types. -#[inline] -pub(crate) const fn default_cow_str() -> Cow<'static, str> { - Cow::Borrowed("") -} - /// Default [`String`] type used in request/response types. #[inline] pub(crate) const fn default_string() -> String { diff --git a/rpc/types/src/free.rs b/rpc/types/src/free.rs index 043a520..45fb2f7 100644 --- a/rpc/types/src/free.rs +++ b/rpc/types/src/free.rs @@ -6,6 +6,7 @@ /// Returns `true` if the input `u` is equal to `0`. #[inline] #[allow(clippy::trivially_copy_pass_by_ref)] // serde needs `&` +#[allow(dead_code)] // TODO: see if needed after handlers. pub(crate) const fn is_zero(u: &u64) -> bool { *u == 0 } @@ -13,6 +14,7 @@ pub(crate) const fn is_zero(u: &u64) -> bool { /// Returns `true` the input `u` is equal to `1`. #[inline] #[allow(clippy::trivially_copy_pass_by_ref)] // serde needs `&` +#[allow(dead_code)] // TODO: see if needed after handlers. pub(crate) const fn is_one(u: &u64) -> bool { *u == 1 } diff --git a/rpc/types/src/json.rs b/rpc/types/src/json.rs index 4971061..cfefcf9 100644 --- a/rpc/types/src/json.rs +++ b/rpc/types/src/json.rs @@ -12,12 +12,11 @@ use crate::{ default_false, default_height, default_one, default_string, default_true, default_vec, default_zero, }, - free::{is_one, is_zero}, macros::define_request_and_response, misc::{ AuxPow, BlockHeader, ChainInfo, ConnectionInfo, Distribution, GetBan, - GetMinerDataTxBacklogEntry, HardforkEntry, HistogramEntry, OutputDistributionData, SetBan, - Span, Status, SyncInfoPeer, TxBacklogEntry, + GetMinerDataTxBacklogEntry, HardforkEntry, HistogramEntry, SetBan, Span, Status, + SyncInfoPeer, TxBacklogEntry, }, rpc_call::RpcCallValue, }; diff --git a/rpc/types/src/lib.rs b/rpc/types/src/lib.rs index b48f22e..c5f890f 100644 --- a/rpc/types/src/lib.rs +++ b/rpc/types/src/lib.rs @@ -4,37 +4,37 @@ // Forbid lints. // Our code, and code generated (e.g macros) cannot overrule these. #![forbid( - // `unsafe` is allowed but it _must_ be - // commented with `SAFETY: reason`. - clippy::undocumented_unsafe_blocks, + // `unsafe` is allowed but it _must_ be + // commented with `SAFETY: reason`. + clippy::undocumented_unsafe_blocks, - // Never. - unused_unsafe, - redundant_semicolons, - unused_allocation, - coherence_leak_check, - while_true, + // Never. + unused_unsafe, + redundant_semicolons, + unused_allocation, + coherence_leak_check, + while_true, - // Maybe can be put into `#[deny]`. - unconditional_recursion, - for_loops_over_fallibles, - unused_braces, - unused_labels, - keyword_idents, - non_ascii_idents, - variant_size_differences, + // Maybe can be put into `#[deny]`. + unconditional_recursion, + for_loops_over_fallibles, + unused_braces, + unused_labels, + keyword_idents, + non_ascii_idents, + variant_size_differences, single_use_lifetimes, - // Probably can be put into `#[deny]`. - future_incompatible, - let_underscore, - break_with_label_and_loop, - duplicate_macro_attributes, - exported_private_dependencies, - large_assignments, - overlapping_range_endpoints, - semicolon_in_expressions_from_macros, - noop_method_call, + // Probably can be put into `#[deny]`. + future_incompatible, + let_underscore, + break_with_label_and_loop, + duplicate_macro_attributes, + exported_private_dependencies, + large_assignments, + overlapping_range_endpoints, + semicolon_in_expressions_from_macros, + noop_method_call, )] // Deny lints. // Some of these are `#[allow]`'ed on a per-case basis. @@ -57,39 +57,27 @@ unreachable_pub )] #![allow( - // FIXME: this lint affects crates outside of - // `database/` for some reason, allow for now. - clippy::cargo_common_metadata, + // FIXME: this lint affects crates outside of + // `database/` for some reason, allow for now. + clippy::cargo_common_metadata, - // FIXME: adding `#[must_use]` onto everything - // might just be more annoying than useful... - // although it is sometimes nice. - clippy::must_use_candidate, + // FIXME: adding `#[must_use]` onto everything + // might just be more annoying than useful... + // although it is sometimes nice. + clippy::must_use_candidate, - // FIXME: good lint but too many false positives - // with our `Env` + `RwLock` setup. - clippy::significant_drop_tightening, + // FIXME: good lint but too many false positives + // with our `Env` + `RwLock` setup. + clippy::significant_drop_tightening, - // FIXME: good lint but is less clear in most cases. - clippy::items_after_statements, + // FIXME: good lint but is less clear in most cases. + clippy::items_after_statements, - // TODO - rustdoc::bare_urls, - - clippy::module_name_repetitions, - clippy::module_inception, - clippy::redundant_pub_crate, - clippy::option_if_let_else, -)] -// Allow some lints when running in debug mode. -#![cfg_attr( - debug_assertions, - allow( - clippy::todo, - clippy::multiple_crate_versions, - unused_imports, - unused_variables - ) + clippy::multiple_crate_versions, + clippy::module_name_repetitions, + clippy::module_inception, + clippy::redundant_pub_crate, + clippy::option_if_let_else, )] // Allow some lints in tests. #![cfg_attr( @@ -101,11 +89,6 @@ clippy::too_many_lines ) )] -// TODO: remove me after finishing impl -#![allow( - dead_code, - rustdoc::broken_intra_doc_links // TODO: remove after `{bin,json,other}.rs` gets merged -)] //---------------------------------------------------------------------------------------------------- Mod mod constants; diff --git a/rpc/types/src/misc/distribution.rs b/rpc/types/src/misc/distribution.rs index 1a488d4..55d509e 100644 --- a/rpc/types/src/misc/distribution.rs +++ b/rpc/types/src/misc/distribution.rs @@ -1,17 +1,14 @@ //! Output distributions for [`crate::json::GetOutputDistributionResponse`]. //---------------------------------------------------------------------------------------------------- Use -use std::mem::size_of; - #[cfg(feature = "serde")] -use serde::{ser::SerializeStruct, Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; #[cfg(feature = "epee")] use cuprate_epee_encoding::{ epee_object, error, macros::bytes::{Buf, BufMut}, - read_epee_value, read_varint, write_field, write_varint, EpeeObject, EpeeObjectBuilder, - EpeeValue, Marker, + read_epee_value, write_field, EpeeObject, EpeeObjectBuilder, EpeeValue, }; //---------------------------------------------------------------------------------------------------- Free @@ -24,7 +21,7 @@ use cuprate_epee_encoding::{ 45..=55 )] #[cfg(feature = "epee")] -fn compress_integer_array(array: &[u64]) -> error::Result> { +fn compress_integer_array(_: &[u64]) -> error::Result> { todo!() } @@ -36,7 +33,7 @@ fn compress_integer_array(array: &[u64]) -> error::Result> { "rpc/core_rpc_server_commands_defs.h", 57..=72 )] -fn decompress_integer_array(array: &[u8]) -> Vec { +fn decompress_integer_array(_: &[u8]) -> Vec { todo!() } @@ -281,9 +278,9 @@ impl EpeeObject for Distribution { //---------------------------------------------------------------------------------------------------- Tests #[cfg(test)] mod tests { - use pretty_assertions::assert_eq; + // use pretty_assertions::assert_eq; - use super::*; + // use super::*; // TODO: re-enable tests after (de)compression functions are implemented. diff --git a/rpc/types/src/misc/misc.rs b/rpc/types/src/misc/misc.rs index 2b31cab..842997b 100644 --- a/rpc/types/src/misc/misc.rs +++ b/rpc/types/src/misc/misc.rs @@ -5,23 +5,13 @@ //! the [`crate::misc::ConnectionInfo`] struct defined here. //---------------------------------------------------------------------------------------------------- Import -use std::fmt::Display; - #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; #[cfg(feature = "epee")] -use cuprate_epee_encoding::{ - epee_object, - macros::bytes::{Buf, BufMut}, - EpeeValue, Marker, -}; +use cuprate_epee_encoding::epee_object; use crate::{ - constants::{ - CORE_RPC_STATUS_BUSY, CORE_RPC_STATUS_NOT_MINING, CORE_RPC_STATUS_OK, - CORE_RPC_STATUS_PAYMENT_REQUIRED, - }, defaults::{default_string, default_zero}, macros::monero_definition_link, }; diff --git a/rpc/types/src/misc/tx_entry.rs b/rpc/types/src/misc/tx_entry.rs index e643076..5151cee 100644 --- a/rpc/types/src/misc/tx_entry.rs +++ b/rpc/types/src/misc/tx_entry.rs @@ -8,9 +8,9 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "epee")] use cuprate_epee_encoding::{ - epee_object, error, + error, macros::bytes::{Buf, BufMut}, - read_epee_value, write_field, EpeeObject, EpeeObjectBuilder, EpeeValue, Marker, + EpeeObject, EpeeObjectBuilder, }; //---------------------------------------------------------------------------------------------------- TxEntry @@ -123,7 +123,7 @@ impl Default for TxEntry { //---------------------------------------------------------------------------------------------------- Epee #[cfg(feature = "epee")] impl EpeeObjectBuilder for () { - fn add_field(&mut self, name: &str, r: &mut B) -> error::Result { + fn add_field(&mut self, _: &str, _: &mut B) -> error::Result { unreachable!() } @@ -140,7 +140,7 @@ impl EpeeObject for TxEntry { unreachable!() } - fn write_fields(self, w: &mut B) -> error::Result<()> { + fn write_fields(self, _: &mut B) -> error::Result<()> { unreachable!() } } diff --git a/rpc/types/src/other.rs b/rpc/types/src/other.rs index 9457250..28c95d2 100644 --- a/rpc/types/src/other.rs +++ b/rpc/types/src/other.rs @@ -11,10 +11,9 @@ use crate::{ defaults::{default_false, default_string, default_true, default_vec, default_zero}, macros::define_request_and_response, misc::{ - GetOutputsOut, KeyImageSpentStatus, OutKey, Peer, PublicNode, SpentKeyImageInfo, Status, - TxEntry, TxInfo, TxpoolStats, + GetOutputsOut, OutKey, Peer, PublicNode, SpentKeyImageInfo, Status, TxEntry, TxInfo, + TxpoolStats, }, - rpc_call::RpcCall, RpcCallValue, }; @@ -191,7 +190,7 @@ define_request_and_response! { } )] AccessResponseBase { - /// FIXME: These are [`KeyImageSpentStatus`] in [`u8`] form. + /// FIXME: These are [`KeyImageSpentStatus`](crate::misc::KeyImageSpentStatus) in [`u8`] form. spent_status: Vec, } } diff --git a/rpc/types/src/serde.rs b/rpc/types/src/serde.rs index 70885e0..e624a66 100644 --- a/rpc/types/src/serde.rs +++ b/rpc/types/src/serde.rs @@ -28,5 +28,5 @@ where //---------------------------------------------------------------------------------------------------- Tests #[cfg(test)] mod test { - use super::*; + // use super::*; } diff --git a/storage/blockchain/src/lib.rs b/storage/blockchain/src/lib.rs index 9db0862..ec6d082 100644 --- a/storage/blockchain/src/lib.rs +++ b/storage/blockchain/src/lib.rs @@ -3,39 +3,39 @@ // Forbid lints. // Our code, and code generated (e.g macros) cannot overrule these. #![forbid( - // `unsafe` is allowed but it _must_ be - // commented with `SAFETY: reason`. - clippy::undocumented_unsafe_blocks, + // `unsafe` is allowed but it _must_ be + // commented with `SAFETY: reason`. + clippy::undocumented_unsafe_blocks, - // Never. - unused_unsafe, - redundant_semicolons, - unused_allocation, - coherence_leak_check, - while_true, - clippy::missing_docs_in_private_items, + // Never. + unused_unsafe, + redundant_semicolons, + unused_allocation, + coherence_leak_check, + while_true, + clippy::missing_docs_in_private_items, - // Maybe can be put into `#[deny]`. - unconditional_recursion, - for_loops_over_fallibles, - unused_braces, - unused_labels, - keyword_idents, - non_ascii_idents, - variant_size_differences, + // Maybe can be put into `#[deny]`. + unconditional_recursion, + for_loops_over_fallibles, + unused_braces, + unused_labels, + keyword_idents, + non_ascii_idents, + variant_size_differences, single_use_lifetimes, - // Probably can be put into `#[deny]`. - future_incompatible, - let_underscore, - break_with_label_and_loop, - duplicate_macro_attributes, - exported_private_dependencies, - large_assignments, - overlapping_range_endpoints, - semicolon_in_expressions_from_macros, - noop_method_call, - unreachable_pub, + // Probably can be put into `#[deny]`. + future_incompatible, + let_underscore, + break_with_label_and_loop, + duplicate_macro_attributes, + exported_private_dependencies, + large_assignments, + overlapping_range_endpoints, + semicolon_in_expressions_from_macros, + noop_method_call, + unreachable_pub, )] // Deny lints. // Some of these are `#[allow]`'ed on a per-case basis. @@ -58,26 +58,26 @@ nonstandard_style )] #![allow( - // FIXME: this lint affects crates outside of - // `database/` for some reason, allow for now. - clippy::cargo_common_metadata, + // FIXME: this lint affects crates outside of + // `database/` for some reason, allow for now. + clippy::cargo_common_metadata, - // FIXME: adding `#[must_use]` onto everything - // might just be more annoying than useful... - // although it is sometimes nice. - clippy::must_use_candidate, + // FIXME: adding `#[must_use]` onto everything + // might just be more annoying than useful... + // although it is sometimes nice. + clippy::must_use_candidate, - // FIXME: good lint but too many false positives - // with our `Env` + `RwLock` setup. - clippy::significant_drop_tightening, + // FIXME: good lint but too many false positives + // with our `Env` + `RwLock` setup. + clippy::significant_drop_tightening, - // FIXME: good lint but is less clear in most cases. - clippy::items_after_statements, + // FIXME: good lint but is less clear in most cases. + clippy::items_after_statements, - clippy::module_name_repetitions, - clippy::module_inception, - clippy::redundant_pub_crate, - clippy::option_if_let_else, + clippy::module_name_repetitions, + clippy::module_inception, + clippy::redundant_pub_crate, + clippy::option_if_let_else, )] // Allow some lints when running in debug mode. #![cfg_attr( diff --git a/storage/database/src/lib.rs b/storage/database/src/lib.rs index da36b0d..5946fe5 100644 --- a/storage/database/src/lib.rs +++ b/storage/database/src/lib.rs @@ -3,39 +3,39 @@ // Forbid lints. // Our code, and code generated (e.g macros) cannot overrule these. #![forbid( - // `unsafe` is allowed but it _must_ be - // commented with `SAFETY: reason`. - clippy::undocumented_unsafe_blocks, + // `unsafe` is allowed but it _must_ be + // commented with `SAFETY: reason`. + clippy::undocumented_unsafe_blocks, - // Never. - unused_unsafe, - redundant_semicolons, - unused_allocation, - coherence_leak_check, - while_true, - clippy::missing_docs_in_private_items, + // Never. + unused_unsafe, + redundant_semicolons, + unused_allocation, + coherence_leak_check, + while_true, + clippy::missing_docs_in_private_items, - // Maybe can be put into `#[deny]`. - unconditional_recursion, - for_loops_over_fallibles, - unused_braces, - unused_labels, - keyword_idents, - non_ascii_idents, - variant_size_differences, + // Maybe can be put into `#[deny]`. + unconditional_recursion, + for_loops_over_fallibles, + unused_braces, + unused_labels, + keyword_idents, + non_ascii_idents, + variant_size_differences, single_use_lifetimes, - // Probably can be put into `#[deny]`. - future_incompatible, - let_underscore, - break_with_label_and_loop, - duplicate_macro_attributes, - exported_private_dependencies, - large_assignments, - overlapping_range_endpoints, - semicolon_in_expressions_from_macros, - noop_method_call, - unreachable_pub, + // Probably can be put into `#[deny]`. + future_incompatible, + let_underscore, + break_with_label_and_loop, + duplicate_macro_attributes, + exported_private_dependencies, + large_assignments, + overlapping_range_endpoints, + semicolon_in_expressions_from_macros, + noop_method_call, + unreachable_pub, )] // Deny lints. // Some of these are `#[allow]`'ed on a per-case basis. @@ -58,28 +58,28 @@ nonstandard_style )] #![allow( - // FIXME: this lint affects crates outside of - // `database/` for some reason, allow for now. - clippy::cargo_common_metadata, + // FIXME: this lint affects crates outside of + // `database/` for some reason, allow for now. + clippy::cargo_common_metadata, - // FIXME: adding `#[must_use]` onto everything - // might just be more annoying than useful... - // although it is sometimes nice. - clippy::must_use_candidate, + // FIXME: adding `#[must_use]` onto everything + // might just be more annoying than useful... + // although it is sometimes nice. + clippy::must_use_candidate, - // FIXME: good lint but too many false positives - // with our `Env` + `RwLock` setup. - clippy::significant_drop_tightening, + // FIXME: good lint but too many false positives + // with our `Env` + `RwLock` setup. + clippy::significant_drop_tightening, - // FIXME: good lint but is less clear in most cases. - clippy::items_after_statements, + // FIXME: good lint but is less clear in most cases. + clippy::items_after_statements, - clippy::module_name_repetitions, - clippy::module_inception, - clippy::redundant_pub_crate, - clippy::option_if_let_else, + clippy::module_name_repetitions, + clippy::module_inception, + clippy::redundant_pub_crate, + clippy::option_if_let_else, - // unused_crate_dependencies, // false-positive with `paste` + // unused_crate_dependencies, // false-positive with `paste` )] // Allow some lints when running in debug mode. #![cfg_attr(