Skip to content

Commit

Permalink
[cr133][rust] Fix unused imports in brave code
Browse files Browse the repository at this point in the history
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 <[email protected]>
Date:   Thu Jan 2 13:45:03 2025 -0800

    Stop globally disabling `unused-imports` lint when compiling Rust.

    rust-lang/rust#121708 (comment)
    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
  • Loading branch information
cdesouza-chromium authored and mkarolin committed Jan 27, 2025
1 parent d1da4c5 commit 1072764
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions components/brave_wallet/browser/zcash/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -36,7 +35,6 @@ use zcash_primitives::{
transaction::components::amount::Amount};

use incrementalmerkletree::{
frontier::{self, Frontier},
Address,
Position,
Retention};
Expand All @@ -50,7 +48,6 @@ use zcash_note_encryption::{
};

use shardtree::{
error::ShardTreeError,
store::{Checkpoint, ShardStore, TreeState},
LocatedPrunableTree, LocatedTree, PrunableTree, RetentionFlags,
ShardTree,
Expand All @@ -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]
Expand Down Expand Up @@ -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! {
Expand Down

0 comments on commit 1072764

Please sign in to comment.