Skip to content

Clean dependencies and imports#123

Merged
ChrisSon15 merged 4 commits intobisq-network:mainfrom
stejbac:clean-dependencies-and-imports
Feb 20, 2026
Merged

Clean dependencies and imports#123
ChrisSon15 merged 4 commits intobisq-network:mainfrom
stejbac:clean-dependencies-and-imports

Conversation

@stejbac
Copy link
Copy Markdown
Contributor

@stejbac stejbac commented Feb 19, 2026

Organise workspace and individual crate dependencies into a more canonical order, making sure the versions of any dependencies used by more than one project crate are specified in the workspace manifest instead of the individual crate. Also remove any unneeded dependencies from the manifests (such as rustls & log) and run cargo update to bring them all to their latest (compatible) versions.

Additionally, replace once_cell::sync::Lazy with the similar std::sync::LazyLock for one less (direct) dependency, and canonicalise any source file import lists that had fallen out of kilter with the rustfmt config settings. Also import traits anonymously where possible.

Finally do some minor additional cleanup of the source files, in particular testenv/src/lib.rs.

Organise workspace/crate dependencies into a more canonical order, and
make sure the versions of any dependencies used by more than one project
crate are specified in the workspace manifest. Also run "cargo update"
and use the 0.9 version of 'rand' in 'testenv' instead of 0.8.

Additionally, remove 'log' & 'rustls' from the dependencies as they are
no longer directly used.

Finally, substitute the drop-in replacement 'std::sync::LazyLock' for
'once_cell::sync::Lazy' to avoid a direct dependency on 'once_cell'
(though it is still used by many upstream crates).
Ensure the import lists of all the Rust source files are canonicalised
in accordance with the 'StdExternalCrate' rustfmt config setting, which
some files had fallen out of agreement with.

Also import traits anonymously using "as _" where possible to minimise
namespace pollution (and to make it clear that the trait is not used
directly), and remove a few cases of unnecessary import qualification in
the code.
1) Replace some 'match' expressions with 'let-else' to shorten;
2) Whitespace (missing/spurious newlines);
3) Inline format strings where possible;
4) Fix typos in identifiers;
5) Fix/move some doc-comments & remove some commented-out code;
6) Add missing '#[ignore]' reason;
7) Use 'assert_(eq|ne)' where possible;
8) Convert from f64 using 'Amount::from_btc' instead of 'from_sat'.

(These were mainly flagged by the IDE and temporarily enabled pedantic-
level Clippy lints.)
1) Replace impl name with 'Self' where possible;
2) Fix a few typos in identifiers and elsewhere;
3) Break up long numeric literals with '_' and remove a magic number;
4) Whitespace (missing/spurious newlines & spaces);
5) Comment out "env.start_explorer_in_container" to fix protocol tests;
6) Add missing semicolons to single-line statements for consistency;
7) Change block to line comments to avoid IDE autoformatter conflicts;
8) Fix doc-comments in 'wallet::protocol_wallet_api'.
@stejbac stejbac force-pushed the clean-dependencies-and-imports branch from 06dbd76 to 6638ddc Compare February 19, 2026 23:18
Copy link
Copy Markdown
Contributor

@sdmg15 sdmg15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup ACK

Comment thread Cargo.toml
rustls = { version = "0.23.35", default-features = false, features = ["ring", "std", "tls12", "logging"] }
bdk_kyoto = "0.15.4"
# v2.2.0 deprecates `bdk_wallet::wallet::signer` without making it clear what alternative to use & how:
bdk_wallet = { version = "~2.1.0", features = ["rusqlite", "keys-bip39"] }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could also narrow this down and add default-features = false?

@ChrisSon15 ChrisSon15 merged commit 2d7aed8 into bisq-network:main Feb 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants