Repository: probe-rs/probe-rs
Pull request #2511 (2024-05-29 08:12:51)

Trim dependency features, clean up some code
Note that the textwrap change may end up changing the default wrap algorithm depending on the outcome of https://github.com/zkat/miette/pull/379 but the effect shouldn't be important.

Also includes parts of https://github.com/probe-rs/probe-rs/pull/2441

The big change is caused by removing rand and crypto crates:
 - we don't need it in examples and benchmark, fastrand should be just enough
 - we don't currently decompress encrypted ZIPs, which require rand and a bunch of crypto


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index 6f9d6454..cc663a40 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -42,17 +42,6 @@ version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
 
-[[package]]
-name = "aes"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
-dependencies = [
- "cfg-if",
- "cipher",
- "cpufeatures",
-]
-
 [[package]]
 name = "ahash"
 version = "0.8.11"
@@ -186,21 +175,6 @@ dependencies = [
  "wait-timeout",
 ]
 
-[[package]]
-name = "assert_fs"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2cd762e110c8ed629b11b6cde59458cc1c71de78ebbcc30099fc8e0403a2a2ec"
-dependencies = [
- "anstyle",
- "doc-comment",
- "globwalk",
- "predicates",
- "predicates-core",
- "predicates-tree",
- "tempfile",
-]
-
 [[package]]
 name = "async-io"
 version = "2.3.2"
@@ -530,16 +504,6 @@ version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
 
-[[package]]
-name = "cipher"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
-dependencies = [
- "crypto-common",
- "inout",
-]
-
 [[package]]
 name = "clap"
 version = "4.5.4"
@@ -598,15 +562,6 @@ dependencies = [
  "error-code",
 ]
 
-[[package]]
-name = "cmake"
-version = "0.1.50"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130"
-dependencies = [
- "cc",
-]
-
 [[package]]
 name = "cmsis-pack"
 version = "0.7.0"
@@ -675,12 +630,6 @@ dependencies = [
  "windows-sys 0.52.0",
 ]
 
-[[package]]
-name = "constant_time_eq"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2"
-
 [[package]]
 name = "core-foundation"
 version = "0.9.4"
@@ -748,25 +697,6 @@ dependencies = [
  "crossbeam-utils",
 ]
 
-[[package]]
-name = "crossbeam-deque"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
-dependencies = [
- "crossbeam-epoch",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.9.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
-dependencies = [
- "crossbeam-utils",
-]
-
 [[package]]
 name = "crossbeam-utils"
 version = "0.8.19"
@@ -985,7 +915,6 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
 dependencies = [
  "block-buffer",
  "crypto-common",
- "subtle",
 ]
 
 [[package]]
@@ -1070,12 +999,6 @@ version = "0.3.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
 
-[[package]]
-name = "endian-type"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
-
 [[package]]
 name = "env_logger"
 version = "0.10.2"
@@ -1188,9 +1111,9 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
 
 [[package]]
 name = "fastrand"
-version = "2.0.2"
+version = "2.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984"
+checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
 
 [[package]]
 name = "fd-lock"
@@ -1226,7 +1149,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
 dependencies = [
  "crc32fast",
- "libz-ng-sys",
  "miniz_oxide",
 ]
 
@@ -1314,10 +1236,7 @@ version = "2.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
 dependencies = [
- "fastrand",
  "futures-core",
- "futures-io",
- "parking",
  "pin-project-lite",
 ]
 
@@ -1451,30 +1370,6 @@ dependencies = [
  "syn 2.0.60",
 ]
 
-[[package]]
-name = "globset"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1"
-dependencies = [
- "aho-corasick",
- "bstr",
- "log",
- "regex-automata 0.4.6",
- "regex-syntax 0.8.3",
-]
-
-[[package]]
-name = "globwalk"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757"
-dependencies = [
- "bitflags 2.5.0",
- "ignore",
- "walkdir",
-]
-
 [[package]]
 name = "goblin"
 version = "0.8.2"
@@ -1580,15 +1475,6 @@ dependencies = [
  "windows-sys 0.48.0",
 ]
 
-[[package]]
-name = "hmac"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
-dependencies = [
- "digest",
-]
-
 [[package]]
 name = "home"
 version = "0.5.9"
@@ -1716,22 +1602,6 @@ dependencies = [
  "unicode-normalization",
 ]
 
-[[package]]
-name = "ignore"
-version = "0.4.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1"
-dependencies = [
- "crossbeam-deque",
- "globset",
- "log",
- "memchr",
- "regex-automata 0.4.6",
- "same-file",
- "walkdir",
- "winapi-util",
-]
-
 [[package]]
 name = "ihex"
 version = "3.0.0"
@@ -1773,25 +1643,14 @@ version = "0.1.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb"
 
-[[package]]
-name = "inout"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
-dependencies = [
- "generic-array 0.14.7",
-]
-
 [[package]]
 name = "insta"
 version = "1.38.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3eab73f58e59ca6526037208f0e98851159ec1633cf17b6cd2e1f2c3fd5d53cc"
 dependencies = [
- "console",
  "lazy_static",
  "linked-hash-map",
- "regex",
  "serde",
  "similar",
 ]
@@ -1873,6 +1732,15 @@ dependencies = [
  "either",
 ]
 
+[[package]]
+name = "itertools"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
+dependencies = [
+ "either",
+]
+
 [[package]]
 name = "itm"
 version = "0.9.0-rc.1"
@@ -1961,16 +1829,6 @@ dependencies = [
  "pkg-config",
 ]
 
-[[package]]
-name = "libz-ng-sys"
-version = "1.1.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6409efc61b12687963e602df8ecf70e8ddacf95bc6576bcf16e3ac6328083c5"
-dependencies = [
- "cmake",
- "libc",
-]
-
 [[package]]
 name = "linked-hash-map"
 version = "0.5.6"
@@ -2169,15 +2027,6 @@ dependencies = [
  "windows-sys 0.48.0",
 ]
 
-[[package]]
-name = "nibble_vec"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43"
-dependencies = [
- "smallvec",
-]
-
 [[package]]
 name = "nix"
 version = "0.27.1"
@@ -2378,16 +2227,6 @@ version = "1.0.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
 
-[[package]]
-name = "pbkdf2"
-version = "0.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
-dependencies = [
- "digest",
- "hmac",
-]
-
 [[package]]
 name = "pear"
 version = "0.2.9"
@@ -2488,12 +2327,6 @@ version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
 
-[[package]]
-name = "ppv-lite86"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
-
 [[package]]
 name = "predicates"
 version = "3.1.0"
@@ -2558,6 +2391,7 @@ dependencies = [
  "docsplay",
  "dunce",
  "espflash",
+ "fastrand",
  "futures-lite",
  "gdbstub",
  "gimli 0.29.0",
@@ -2565,7 +2399,7 @@ dependencies = [
  "hidapi",
  "ihex",
  "insta",
- "itertools 0.12.1",
+ "itertools 0.13.0",
  "itm",
  "jep106",
  "miniz_oxide",
@@ -2574,17 +2408,14 @@ dependencies = [
  "once_cell",
  "parking_lot",
  "parse_int",
- "paste",
  "pretty_assertions",
  "pretty_env_logger",
  "probe-rs-target",
- "rand",
  "rmp-serde",
  "scroll",
  "serde",
  "serde_json",
  "serde_yaml",
- "static_assertions",
  "svg",
  "termtree",
  "test-case",
@@ -2634,13 +2465,14 @@ dependencies = [
  "directories",
  "docsplay",
  "dunce",
+ "fastrand",
  "figment",
  "gimli 0.29.0",
  "git-version",
  "goblin",
  "indicatif",
  "insta",
- "itertools 0.12.1",
+ "itertools 0.13.0",
  "itm",
  "jep106",
  "libtest-mimic",
@@ -2653,7 +2485,6 @@ dependencies = [
  "probe-rs",
  "probe-rs-mi",
  "probe-rs-target",
- "rand",
  "ratatui",
  "regex",
  "rustyline",
@@ -2733,46 +2564,6 @@ version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
 
-[[package]]
-name = "radix_trie"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd"
-dependencies = [
- "endian-type",
- "nibble_vec",
-]
-
-[[package]]
-name = "rand"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
-dependencies = [
- "libc",
- "rand_chacha",
- "rand_core",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom",
-]
-
 [[package]]
 name = "ratatui"
 version = "0.26.2"
@@ -3048,7 +2839,6 @@ dependencies = [
  "log",
  "memchr",
  "nix 0.28.0",
- "radix_trie",
  "unicode-segmentation",
  "unicode-width",
  "utf8parse",
@@ -3072,15 +2862,6 @@ version = "1.0.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"
 
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
 [[package]]
 name = "sanitize-filename"
 version = "0.5.0"
@@ -3286,17 +3067,6 @@ dependencies = [
  "unsafe-libyaml",
 ]
 
-[[package]]
-name = "sha1"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
 [[package]]
 name = "sha2"
 version = "0.10.8"
@@ -3347,12 +3117,6 @@ dependencies = [
  "libc",
 ]
 
-[[package]]
-name = "simd-adler32"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
-
 [[package]]
 name = "similar"
 version = "2.5.0"
@@ -3565,7 +3329,6 @@ version = "0.24.0"
 dependencies = [
  "anyhow",
  "assert_cmd",
- "assert_fs",
  "clap",
  "cmsis-pack",
  "colored",
@@ -3579,6 +3342,7 @@ dependencies = [
  "reqwest",
  "scroll",
  "serde_yaml",
+ "tempfile",
  "tokio",
  "tracing-subscriber",
  "xshell",
@@ -3982,12 +3746,6 @@ dependencies = [
  "static_assertions",
 ]
 
-[[package]]
-name = "typed-arena"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
-
 [[package]]
 name = "typed-path"
 version = "0.8.0"
@@ -4133,16 +3891,6 @@ dependencies = [
  "libc",
 ]
 
-[[package]]
-name = "walkdir"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
-dependencies = [
- "same-file",
- "winapi-util",
-]
-
 [[package]]
 name = "want"
 version = "0.3.1"
@@ -4542,20 +4290,6 @@ name = "zeroize"
 version = "1.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.60",
-]
 
 [[package]]
 name = "zip"
@@ -4563,40 +4297,20 @@ version = "1.2.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c700ea425e148de30c29c580c1f9508b93ca57ad31c9f4e96b83c194c37a7a8f"
 dependencies = [
- "aes",
  "arbitrary",
  "bzip2",
- "constant_time_eq",
  "crc32fast",
  "crossbeam-utils",
  "deflate64",
  "displaydoc",
  "flate2",
- "hmac",
  "indexmap",
  "lzma-rs",
- "pbkdf2",
- "rand",
- "sha1",
  "thiserror",
  "time",
- "zeroize",
- "zopfli",
  "zstd",
 ]
 
-[[package]]
-name = "zopfli"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c1f48f3508a3a3f2faee01629564400bc12260f6214a056d06a3aaaa6ef0736"
-dependencies = [
- "crc32fast",
- "log",
- "simd-adler32",
- "typed-arena",
-]
-
 [[package]]
 name = "zstd"
 version = "0.13.1"
diff --git a/README.md b/README.md
index d8f7a7d4..602069d0 100644
--- a/README.md
+++ b/README.md
@@ -47,14 +47,14 @@ See <https://probe.rs/docs/getting-started/installation/> for a more detailed gu
 #### Using a shell script
 
 ```sh
-curl --proto '=https' --tlsv1.2 -LsSf https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-installer.sh | sh
+curl --proto '=https' --tlsv1.2 -LsSf https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.sh | sh
 ```
 
 #### Using a powershell script
 
 
 ```sh
-irm https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-installer.ps1 | iex
+irm https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.ps1 | iex
 ```
 
 #### From source
diff --git a/probe-rs-tools/Cargo.toml b/probe-rs-tools/Cargo.toml
index 274a1687..d1c9331a 100644
--- a/probe-rs-tools/Cargo.toml
+++ b/probe-rs-tools/Cargo.toml
@@ -40,49 +40,44 @@ typed-path = "0.8"
 probe-rs-target = { workspace = true }
 probe-rs-mi = { workspace = true }
 
-itertools = { version = "0.12" }
+itertools = "0.13"
 
 # CLI-only
-addr2line = { version = "0.22" }
-bytesize = { version = "1" }
-capstone = { version = "0.12" }
-cargo_metadata = { version = "0.18" }
+addr2line = "0.22"
+bytesize = "1"
+capstone = "0.12"
+cargo_metadata = "0.18"
 clap = { version = "4", features = ["derive", "env"] }
-colored = { version = "2" }
-crossterm = { version = "<= 0.27" }
+colored = "2"
+crossterm = "<= 0.27"
 defmt-decoder = { version = "=0.3.11", features = [
     "unstable",
 ] } # pinned because "unstable" has potential for breaking changes
-directories = { version = "5" }
-dunce = { version = "1" }
+directories = "5"
+dunce = "1"
 figment = { version = "0.10", features = ["toml", "json", "yaml", "env"] }
-goblin = { version = "0.8" }
-indicatif = { version = "0.17" }
-insta = { version = "1.38", default-features = false, features = [
-    "yaml",
-    "filters",
-] }
+goblin = { version = "0.8", default-features = false, features = ["elf32", "elf64", "endian_fd"] }
+indicatif = "0.17"
+insta = { version = "1.38", default-features = false, features = ["yaml"] }
 itm = { version = "0.9.0-rc.1", default-features = false }
 parse_int = "0.6"
-libtest-mimic = { version = "0.7.2" }
-rand = { version = "0.8" }
-rustyline = { version = "14" }
-sanitize-filename = { version = "0.5" }
-schemafy = { version = "0.6" }
-serde_json = { version = "1.0.116" }
-signal-hook = "0.3"
+libtest-mimic = "0.7.2"
+fastrand = "2.1"
+rustyline = { version = "14", default-features = false, features = ["with-dirs", "with-file-history"] }
+sanitize-filename = "0.5"
+schemafy = "0.6"
+serde_json = "1.0.116"
+signal-hook = { version = "0.3", default-features = false }
 svd-parser = { version = "0.14", features = ["expand"] }
-termtree = { version = "0.4" }
-textwrap = { version = "0.16" }
+termtree = "0.4"
+textwrap = { version = "0.16", default-features = false, features = ["unicode-linebreak", "unicode-width"] }
 time = { version = "0.3", default-features = false, features = [
-    "alloc",
     "formatting",
-    "large-dates",
     "macros",
     "local-offset",
 ] }
 tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
-tracing-appender = { version = "0.2" }
+tracing-appender = "0.2"
 ratatui = { version = "0.26.2", default-features = false, features = [
     "crossterm",
 ] }
@@ -96,11 +91,18 @@ cargo-config2 = "0.1.26"
 clap_complete = "4.5.2"
 regex = "1.10.4"
 semver = "1"
-zip = "1.1.4"
+zip = { version = "1.1.4", default-features = false, features = [
+    "bzip2",
+    "deflate64",
+    "deflate",
+    "lzma",
+    "time",
+    "zstd",
+] }
 urlencoding = "2"
 
 [build-dependencies]
-git-version = { version = "0.3" }
+git-version = "0.3"
 
 [dev-dependencies]
 pretty_assertions = "1.4.0"
diff --git a/probe-rs-tools/src/bin/probe-rs/cmd/benchmark.rs b/probe-rs-tools/src/bin/probe-rs/cmd/benchmark.rs
index 5361de9a..af67791b 100644
--- a/probe-rs-tools/src/bin/probe-rs/cmd/benchmark.rs
+++ b/probe-rs-tools/src/bin/probe-rs/cmd/benchmark.rs
@@ -5,7 +5,6 @@ use std::{
 
 use anyhow::Context;
 use probe_rs::{probe::list::Lister, MemoryInterface};
-use rand::prelude::*;
 
 use crate::util::common_options::LoadedProbeOptions;
 use crate::util::common_options::ProbeOptions;
@@ -230,7 +229,7 @@ impl DataType {
     }
 
     pub fn fill_data(&mut self, data_size_words: usize) {
-        let mut rng = rand::thread_rng();
+        let mut rng = fastrand::Rng::new();
         match self {
             DataType::U8(ref mut test_data, ref mut read_data) => {
                 *test_data = vec![0u8; data_size_words];
@@ -240,12 +239,16 @@ impl DataType {
             DataType::U32(ref mut test_data, ref mut read_data) => {
                 *test_data = vec![0u32; data_size_words];
                 *read_data = vec![0u32; data_size_words];
-                rng.fill(&mut test_data[..]);
+                for out in test_data.iter_mut() {
+                    *out = rng.u32(..);
+                }
             }
             DataType::U64(ref mut test_data, ref mut read_data) => {
                 *test_data = vec![0u64; data_size_words];
                 *read_data = vec![0u64; data_size_words];
-                rng.fill(&mut test_data[..]);
+                for out in test_data.iter_mut() {
+                    *out = rng.u64(..);
+                }
             }
         }
     }
diff --git a/probe-rs-tools/src/bin/probe-rs/cmd/cargo_embed/mod.rs b/probe-rs-tools/src/bin/probe-rs/cmd/cargo_embed/mod.rs
index 659bdce3..fd99c899 100644
--- a/probe-rs-tools/src/bin/probe-rs/cmd/cargo_embed/mod.rs
+++ b/probe-rs-tools/src/bin/probe-rs/cmd/cargo_embed/mod.rs
@@ -4,7 +4,7 @@ mod rttui;
 
 use anyhow::{anyhow, Context, Result};
 use clap::Parser;
-use colored::*;
+use colored::Colorize;
 use parking_lot::FairMutex;
 use probe_rs::gdb_server::GdbInstanceConfiguration;
 use probe_rs::probe::list::Lister;
diff --git a/probe-rs-tools/src/bin/probe-rs/cmd/cargo_flash/diagnostics.rs b/probe-rs-tools/src/bin/probe-rs/cmd/cargo_flash/diagnostics.rs
index 157457a8..889c3ee8 100644
--- a/probe-rs-tools/src/bin/probe-rs/cmd/cargo_flash/diagnostics.rs
+++ b/probe-rs-tools/src/bin/probe-rs/cmd/cargo_flash/diagnostics.rs
@@ -1,5 +1,5 @@
 /// Error handling
-use colored::*;
+use colored::{ColoredString, Colorize};
 use std::error::Error;
 use std::fmt::Write;
 
diff --git a/probe-rs-tools/src/bin/probe-rs/cmd/cargo_flash/mod.rs b/probe-rs-tools/src/bin/probe-rs/cmd/cargo_flash/mod.rs
index 33fd6214..62c1afec 100644
--- a/probe-rs-tools/src/bin/probe-rs/cmd/cargo_flash/mod.rs
+++ b/probe-rs-tools/src/bin/probe-rs/cmd/cargo_flash/mod.rs
@@ -1,7 +1,7 @@
 mod diagnostics;
 
 use clap::Parser;
-use colored::*;
+use colored::Colorize;
 use diagnostics::render_diagnostics;
 use probe_rs::probe::list::Lister;
 use std::ffi::OsString;
diff --git a/probe-rs-tools/src/bin/probe-rs/cmd/dap_server/debug_adapter/dap/dap_types.rs b/probe-rs-tools/src/bin/probe-rs/cmd/dap_server/debug_adapter/dap/dap_types.rs
index 5fafd5ad..56e87d4e 100644
--- a/probe-rs-tools/src/bin/probe-rs/cmd/dap_server/debug_adapter/dap/dap_types.rs
+++ b/probe-rs-tools/src/bin/probe-rs/cmd/dap_server/debug_adapter/dap/dap_types.rs
@@ -1,17 +1,13 @@
-// Ignore clippy warning in the `schemafy!` output
-#![allow(clippy::derive_partial_eq_without_eq)]
-
 // use crate::dap_types2 as debugserver_types;
 use crate::cmd::dap_server::DebuggerError;
 use crate::util::rtt;
 use num_traits::Num;
 use parse_int::parse;
-use schemafy::schemafy;
 use serde::{Deserialize, Serialize};
 use std::fmt::Display;
 
 // Convert the MSDAP `debugAdaptor.json` file into Rust types.
-schemafy!(root: debugserver_types "src/bin/probe-rs/cmd/dap_server/debug_adapter/dap/debugProtocol.json");
+schemafy::schemafy!(root: debugserver_types "src/bin/probe-rs/cmd/dap_server/debug_adapter/dap/debugProtocol.json");
 
 /// Memory addresses come in as strings, but we want to use them as u64s.
 pub struct MemoryAddress(pub u64);
diff --git a/probe-rs-tools/src/bin/probe-rs/cmd/dap_server/mod.rs b/probe-rs-tools/src/bin/probe-rs/cmd/dap_server/mod.rs
index 0216d26a..e3389978 100644
--- a/probe-rs-tools/src/bin/probe-rs/cmd/dap_server/mod.rs
+++ b/probe-rs-tools/src/bin/probe-rs/cmd/dap_server/mod.rs
@@ -1,6 +1,5 @@
 // Bad things happen to the VSCode debug extenison and debug_adapter if we panic at the wrong time.
 #![warn(clippy::unwrap_used, clippy::panic, clippy::expect_used)]
-// Uses Schemafy to generate DAP types from Json
 mod debug_adapter;
 mod peripherals;
 mod server;
diff --git a/probe-rs-tools/src/bin/probe-rs/cmd/debug.rs b/probe-rs-tools/src/bin/probe-rs/cmd/debug.rs
index f2f44f5e..599441d8 100644
--- a/probe-rs-tools/src/bin/probe-rs/cmd/debug.rs
+++ b/probe-rs-tools/src/bin/probe-rs/cmd/debug.rs
@@ -21,7 +21,7 @@ use probe_rs::{
     debug::{debug_info::DebugInfo, registers::DebugRegisters, stack_frame::StackFrame},
     Core, CoreType, InstructionSet, MemoryInterface, RegisterValue,
 };
-use rustyline::DefaultEditor;
+use rustyline::{error::ReadlineError, DefaultEditor};
 
 use crate::{util::common_options::ProbeOptions, CoreOptions};
 
@@ -58,30 +58,22 @@ impl Cmd {
         loop {
             cli_data.print_state()?;
 
-            let readline = rl.readline(">> ");
-            match readline {
+            match rl.readline(">> ") {
                 Ok(line) => {
                     let history_entry: &str = line.as_ref();
                     rl.add_history_entry(history_entry)?;
                     let cli_state = cli.handle_line(&line, &mut cli_data)?;
 
-                    match cli_state {
-                        CliState::Continue => (),
-                        CliState::Stop => break,
+                    if cli_state == CliState::Stop {
+                        break;
                     }
                 }
-                Err(e) => {
-                    use rustyline::error::ReadlineError;
-
-                    match e {
-                        // For end of file and ctrl-c, we just quit
-                        ReadlineError::Eof | ReadlineError::Interrupted => return Ok(()),
-                        actual_error => {
-                            // Show error message and quit
-                            println!("Error handling input: {actual_error:?}");
-                            break;
-                        }
-                    }
+                // For end of file and ctrl-c, we just quit
+                Err(ReadlineError::Eof | ReadlineError::Interrupted) => return Ok(()),
+                Err(actual_error) => {
+                    // Show error message and quit
+                    println!("Error handling input: {actual_error:?}");
+                    break;
                 }
             }
         }
@@ -1084,6 +1076,7 @@ impl HaltedState {
     }
 }
 
+#[derive(PartialEq)]
 pub enum CliState {
     Continue,
     Stop,
diff --git a/probe-rs/Cargo.toml b/probe-rs/Cargo.toml
index f7aff2f2..9fa907e2 100644
--- a/probe-rs/Cargo.toml
+++ b/probe-rs/Cargo.toml
@@ -23,20 +23,22 @@ exclude = ["tests/"]
 default = ["builtin-targets"]
 gdb-server = ["dep:gdbstub"]
 
-
 # Enable all built in targets.
 builtin-targets = []
 
-
 # Enable helpers for testing
 test = []
 
 [dependencies]
-anyhow = { workspace = true }
+anyhow.workspace = true
+docsplay.workspace = true
+thiserror.workspace = true
+probe-rs-target.workspace = true
+
 bincode = "1.3"
 bitfield = "0.15"
+bitflags = "2"
 bitvec = "1"
-docsplay = { workspace = true }
 gimli = { version = "0.29", default-features = false, features = [
     "endian-reader",
     "read",
@@ -46,7 +48,7 @@ hidapi = { version = "2", default-features = false, features = [
     "linux-native",
 ] }
 ihex = "3.0"
-itertools = "0.12.1"
+itertools = "0.13"
 jep106 = "0.2"
 once_cell = "1"
 miniz_oxide = "0.7"
@@ -55,45 +57,40 @@ object = { version = "0.35", default-features = false, features = [
     "read_core",
     "std",
 ] }
-paste = "1"
-nusb = { version = "0.1.9" }
-futures-lite = "2"
+nusb = "0.1.9"
+futures-lite = { version = "2", default-features = false }
 async-io = "2"
 scroll = "0.12"
-serde = { version = "1", features = ["derive"] }
-serde_yaml = "0.9"
-static_assertions = "1"
 svg = "0.17"
-thiserror = { workspace = true }
 tracing = { version = "0.1", features = ["log"] }
 uf2-decode = "0.2"
-rmp-serde = "1"
 typed-path = "0.8"
-bitflags = "2"
 espflash = { version = "3", default-features = false }
-dunce = { version = "1" }
+dunce = "1"
 parse_int = "0.6"
-parking_lot = { version = "0.12.2" }
+parking_lot = "0.12.2"
 zerocopy = "0.7.32"
 zerocopy-derive = "0.7.32"
 
+serde = { version = "1", features = ["derive"] }
+serde_yaml = "0.9"
+rmp-serde = "1"
+
 # optional
 hexdump = { version = "0.1", optional = true }
-# path
-probe-rs-target = { workspace = true }
 
 # gdb server
 gdbstub = { version = "0.7", optional = true }
 
 [build-dependencies]
+probe-rs-target.workspace = true
+
 bincode = "1"
-probe-rs-target = { workspace = true }
 serde_yaml = "0.9"
 
-
 [dev-dependencies]
 pretty_env_logger = "0.5"
-rand = "0.8"
+fastrand = "2.1"
 serde_json = "1"
 serde = "1"
 clap = { version = "4", features = ["derive"] }
@@ -101,7 +98,7 @@ itm = { version = "0.9.0-rc.1", default-features = false }
 pretty_assertions = "1"
 test-case = "3"
 termtree = "0.4"
-insta = { version = "1.38", features = ["yaml", "filters"] }
+insta = { version = "1.38", default-features = false, features = ["yaml"] }
 
 [[package.metadata.release.pre-release-replacements]]
 file = "../CHANGELOG.md"
@@ -112,7 +109,6 @@ file = "../CHANGELOG.md"
 search = "\\[unreleased\\]: https://github.com/probe-rs/probe-rs/compare/v([a-z0-9.-]+)\\.\\.\\.master"
 replace = "[unreleased]: https://github.com/probe-rs/probe-rs/compare/v{{version}}...master\n[{{version}}]: https://github.com/probe-rs/probe-rs/compare/v$1...v{{version}}"
 
-
 [package.metadata.binstall]
 pkg-url = "{ repo }/releases/download/v{ version }/probe-rs-tools-{ target }-v{ version }{ archive-suffix }"
 bin-dir = "probe-rs-tools-{ target }-v{ version }/{ bin }{ binary-ext }"
diff --git a/probe-rs/examples/ram_download.rs b/probe-rs/examples/ram_download.rs
index b6ecca7e..e0b85b00 100644
--- a/probe-rs/examples/ram_download.rs
+++ b/probe-rs/examples/ram_download.rs
@@ -5,8 +5,6 @@ use clap::Parser;
 use std::num::ParseIntError;
 use std::time::{Duration, Instant};
 
-use rand::prelude::*;
-
 use anyhow::{anyhow, Context, Result};
 
 #[derive(clap::Parser)]
@@ -65,11 +63,13 @@ fn main() -> Result<()> {
 
     let data_size_bytes = data_size_words * 4;
 
-    let mut rng = rand::thread_rng();
+    let mut rng = fastrand::Rng::new();
 
     let mut sample_data = vec![0u32; data_size_words];
 
-    rng.fill(&mut sample_data[..]);
+    for out in sample_data.iter_mut() {
+        *out = rng.u32(..);
+    }
 
     core.halt(Duration::from_millis(100))
         .expect("Halting failed");
diff --git a/probe-rs/src/architecture/arm/component/itm.rs b/probe-rs/src/architecture/arm/component/itm.rs
index 9a7d755a..3ef8e010 100644
--- a/probe-rs/src/architecture/arm/component/itm.rs
+++ b/probe-rs/src/architecture/arm/component/itm.rs
@@ -88,7 +88,6 @@ mod register {
     use crate::memory_mapped_bitfield_register;
 
     memory_mapped_bitfield_register! {
-        #[allow(non_camel_case_types)]
         pub struct ITM_TER(u32);
         0xE00,"ITM_TER",
         impl From;
diff --git a/probe-rs/src/architecture/arm/component/scs.rs b/probe-rs/src/architecture/arm/component/scs.rs
index c23e4a24..8c1ade27 100644
--- a/probe-rs/src/architecture/arm/component/scs.rs
+++ b/probe-rs/src/architecture/arm/component/scs.rs
@@ -41,7 +41,6 @@ mod register {
 
     memory_mapped_bitfield_register! {
         /// B3.2.3 CPUID Base Register
-        #[allow(non_camel_case_types)]
         pub struct CPUID(u32);
         0xD00, "CPUID",
         impl From;
diff --git a/probe-rs/src/core/memory_mapped_registers.rs b/probe-rs/src/core/memory_mapped_registers.rs
index 4de4a68d..3813f0ef 100644
--- a/probe-rs/src/core/memory_mapped_registers.rs
+++ b/probe-rs/src/core/memory_mapped_registers.rs
@@ -76,15 +76,15 @@ macro_rules! memory_mapped_bitfield_register {
     };
     ($(#[$outer:meta])* $vis_modifier:vis struct $struct_name:ident($reg_type:ty); $addr:expr, $reg_name:expr, $($rest:tt)*) => {
         // Using paste here, because as of bitfield = "0.14.0" they do not use the 'vis' specifier, and balks at being passed a visibility token.
-        paste::paste!{
-            bitfield::bitfield!{
-                $(#[$outer])*
-                #[doc= concat!("A [`bitfield::bitfield!`] register mapping for the register `",  $reg_name, "` located at address `", stringify!($addr), "`.")]
-                #[derive(Copy, Clone)]
-                $vis_modifier struct $struct_name($reg_type);
-                impl Debug;
-                $($rest)*
-            }
+        bitfield::bitfield!{
+            $(#[$outer])*
+            #[doc= concat!("A [`bitfield::bitfield!`] register mapping for the register `",  $reg_name, "` located at address `", stringify!($addr), "`.")]
+            #[derive(Copy, Clone)]
+            #[allow(clippy::upper_case_acronyms)]
+            #[allow(non_camel_case_types)]
+            ($vis_modifier) struct $struct_name($reg_type);
+            impl Debug;
+            $($rest)*
         }
 
         impl $crate::MemoryMappedRegister<$reg_type> for $struct_name {
diff --git a/probe-rs/src/session.rs b/probe-rs/src/session.rs
index e9c46d77..0d9b23f6 100644
--- a/probe-rs/src/session.rs
+++ b/probe-rs/src/session.rs
@@ -778,7 +778,11 @@ impl Session {
 }
 
 // This test ensures that [Session] is fully [Send] + [Sync].
-static_assertions::assert_impl_all!(Session: Send);
+const _: fn() = || {
+    fn assert_impl_all<T: ?Sized + Send>() {}
+
+    assert_impl_all::<Session>();
+};
 
 // TODO tiwalun: Enable again, after rework of Session::new is done.
 impl Drop for Session {
diff --git a/target-gen/Cargo.toml b/target-gen/Cargo.toml
index b91d84c1..0f03185e 100644
--- a/target-gen/Cargo.toml
+++ b/target-gen/Cargo.toml
@@ -17,7 +17,7 @@ license.workspace = true
 [dependencies]
 probe-rs = { path = "../probe-rs", version = "0.24.0", default-features = false }
 probe-rs-target = { path = "../probe-rs-target", version = "0.24.0", default-features = false }
-cmsis-pack = { version = "0.7.0" }
+cmsis-pack = "0.7.0"
 goblin = { version = "0.8.2", default-features = false, features = [
     "elf32",
     "elf64",
@@ -26,9 +26,16 @@ goblin = { version = "0.8.2", default-features = false, features = [
     "std",
 ] }
 scroll = "0.12.0"
-serde_yaml = "^0.9.34"
+serde_yaml = "0.9"
 log = "0.4.21"
-zip = "1.0.0"
+zip = { version = "1.1.4", default-features = false, features = [
+    "bzip2",
+    "deflate64",
+    "deflate",
+    "lzma",
+    "time",
+    "zstd",
+] }
 clap = { version = "4.5", features = ["derive"] }
 colored = "2"
 anyhow = "1.0.82"
@@ -43,9 +50,9 @@ tracing-subscriber = { version = "0.3.18", features = [
     "tracing-log",
 ] }
 xshell = { version = "0.2", default-features = false }
-parse_int = { version = "0.6.0" }
+parse_int = "0.6"
 
 [dev-dependencies]
 assert_cmd = "2.0.14"
 predicates = "3.1.0"
-assert_fs = "1.1.1"
+tempfile = "3.0"


Test patch:
diff --git a/target-gen/tests/extract_pack.rs b/target-gen/tests/extract_pack.rs
index eb9eca10..b3275667 100644
--- a/target-gen/tests/extract_pack.rs
+++ b/target-gen/tests/extract_pack.rs
@@ -18,7 +18,7 @@ fn missing_output_directory() {
 #[test]
 fn extract_target_specs() {
     // create a temporary directory
-    let temp = assert_fs::TempDir::new().unwrap();
+    let temp = tempfile::TempDir::new().unwrap();
 
     let mut cmd = Command::cargo_bin("target-gen").unwrap();