From 923941c71e770e9f033825e0d70534c5ec1ce575 Mon Sep 17 00:00:00 2001 From: Claudio DeSouza Date: Fri, 3 Jan 2025 10:23:43 +0000 Subject: [PATCH] [cr133][rust] Fix unused imports in brave code This warning is now enabled for all chromium code, and it has been triggered with some of the zcash code. Additionally, this change has to correct a lot of the formatting for that file, which seems to have changed considerably. Chromium change: https://chromium.googlesource.com/chromium/src/+/6f81efe9a3d000dcbc952d6f14284c8178a960ec commit 6f81efe9a3d000dcbc952d6f14284c8178a960ec Author: Lukasz Anforowicz Date: Thu Jan 2 13:45:03 2025 -0800 Stop globally disabling `unused-imports` lint when compiling Rust. https://github.com/rust-lang/rust/issues/121708#issuecomment-2075956987 points out that new linting scenarios have been moved into a separate lint. Thanks to this, we no longer need to globally disable this lint in Chromium (some narrower exclusions still need to apply). Bug: chromium:326247202 --- components/brave_wallet/browser/zcash/rust/lib.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/components/brave_wallet/browser/zcash/rust/lib.rs b/components/brave_wallet/browser/zcash/rust/lib.rs index 5c92c3aae9cf..53ba636880ce 100644 --- a/components/brave_wallet/browser/zcash/rust/lib.rs +++ b/components/brave_wallet/browser/zcash/rust/lib.rs @@ -4,14 +4,13 @@ // You can obtain one at https://mozilla.org/MPL/2.0/. use std::{ - cell::RefCell, cmp::{Ord, Ordering}, collections::BTreeSet, convert::TryFrom, error, fmt, io::Cursor, marker::PhantomData, - ops::{Add, Bound, RangeBounds, Sub}, rc::Rc, vec}; + vec}; use orchard::{ builder:: { BuildError as OrchardBuildError, InProgress, Unauthorized, Unproven - }, bundle::{commitments, Bundle}, + }, bundle::Bundle, keys::{FullViewingKey as OrchardFVK, PreparedIncomingViewingKey, Scope as OrchardScope, SpendingKey}, @@ -36,7 +35,6 @@ use zcash_primitives::{ transaction::components::amount::Amount}; use incrementalmerkletree::{ - frontier::{self, Frontier}, Address, Position, Retention}; @@ -50,7 +48,6 @@ use zcash_note_encryption::{ }; use shardtree::{ - error::ShardTreeError, store::{Checkpoint, ShardStore, TreeState}, LocatedPrunableTree, LocatedTree, PrunableTree, RetentionFlags, ShardTree, @@ -67,18 +64,14 @@ use crate::ffi::{ CxxOrchardShardTreeCap, CxxOrchardCheckpoint, CxxOrchardCheckpointBundle, - CxxOrchardCheckpointRetention, CxxOrchardShard, CxxOrchardCompactAction, CxxOrchardOutput, CxxOrchardSpend, - CxxOrchardShardTreeLeaf, CxxOrchardShardTreeLeafs, CxxOrchardShardTreeState }; -use shardtree::error::QueryError; - // The rest of the wallet code should be updated to use this version of unwrap // and then this code can be removed #[macro_export] @@ -115,8 +108,6 @@ macro_rules! impl_result { }; } -use paste::item; - macro_rules! impl_result_option_wrapper { ($t: ty, $rt: ident, $l: ident) => { paste::item! {