diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 308af213..595cc17e 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -70,7 +70,7 @@ jobs: - name: Buld Rust docs run: | rustup toolchain install ${{ steps.nightly.outputs.version }} --profile minimal -t wasm32v1-none -c rust-docs -c rust-src - RUSTDOCFLAGS="--cfg docsrs" cargo +${{ steps.nightly.outputs.version }} doc --workspace --all-features + RUSTDOCFLAGS="--cfg docsrs" cargo +${{ steps.nightly.outputs.version }} doc --workspace --no-deps --all-features mv target/doc docs/_site/rust - name: Upload artifact diff --git a/.gitignore b/.gitignore index ac94d875..32936018 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,14 @@ target + +# Don't commit any `Cargo.lock` which aren't the workspace's +Cargo.lock +!./Cargo.lock + +# Don't commit any `Dockerfile`, as they're auto-generated, except the only one which isn't Dockerfile Dockerfile.fast-epoch !orchestration/runtime/Dockerfile + .test-logs .vscode diff --git a/Cargo.lock b/Cargo.lock index 6b80713c..0d51a75a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,7 +34,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common 0.1.6", - "generic-array 0.14.9", + "generic-array 0.14.7", ] [[package]] @@ -1345,7 +1345,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.9", + "generic-array 0.14.7", ] [[package]] @@ -2070,7 +2070,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array 0.14.9", + "generic-array 0.14.7", "rand_core 0.6.4", "serdect", "subtle", @@ -2094,7 +2094,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.9", + "generic-array 0.14.7", "rand_core 0.6.4", "typenum", ] @@ -2633,7 +2633,7 @@ dependencies = [ "crypto-bigint 0.5.5", "digest 0.10.7", "ff", - "generic-array 0.14.9", + "generic-array 0.14.7", "group", "pkcs8", "rand_core 0.6.4", @@ -3376,9 +3376,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.9" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -3697,12 +3697,7 @@ dependencies = [ [[package]] name = "home" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" -dependencies = [ - "windows-sys 0.61.2", -] +version = "0.5.99" [[package]] name = "http" @@ -4050,7 +4045,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "generic-array 0.14.9", + "generic-array 0.14.7", ] [[package]] @@ -8369,7 +8364,7 @@ checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", - "generic-array 0.14.9", + "generic-array 0.14.7", "pkcs8", "serdect", "subtle", diff --git a/Cargo.toml b/Cargo.toml index 85ecd39c..97927a2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -186,6 +186,9 @@ modular-frost = { path = "crypto/frost" } # https://github.com/rust-lang-nursery/lazy-static.rs/issues/201 lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev = "5735630d46572f1e5377c8f2ba0f79d18f53b10c" } +# These has an `std` alternative since Rust's 2024 edition +home = { path = "patches/home" } + # directories-next was created because directories was unmaintained # directories-next is now unmaintained while directories is maintained # The directories author pulls in ridiculously pointless crates and prefers @@ -245,7 +248,7 @@ redundant_closure_for_method_calls = "deny" redundant_else = "deny" string_add_assign = "deny" string_slice = "deny" -unchecked_duration_subtraction = "deny" +unchecked_time_subtraction = "deny" uninlined_format_args = "deny" unnecessary_box_returns = "deny" unnecessary_join = "deny" @@ -254,3 +257,6 @@ unnested_or_patterns = "deny" unused_async = "deny" unused_self = "deny" zero_sized_map_values = "deny" + +[workspace.lints.rust] +unused = "allow" # TODO: https://github.com/rust-lang/rust/issues/147648 diff --git a/deny.toml b/deny.toml index 015a6018..ecc3c08f 100644 --- a/deny.toml +++ b/deny.toml @@ -141,5 +141,6 @@ allow-git = [ "https://github.com/rust-lang-nursery/lazy-static.rs", "https://github.com/kayabaNerve/elliptic-curves", "https://github.com/monero-oxide/monero-oxide", + "https://github.com/kayabaNerve/monero-oxide", "https://github.com/serai-dex/patch-polkadot-sdk", ] diff --git a/message-queue/src/main.rs b/message-queue/src/main.rs index 85a25edb..5d2de1f8 100644 --- a/message-queue/src/main.rs +++ b/message-queue/src/main.rs @@ -239,8 +239,7 @@ async fn main() { // TODO: Add a magic value with a key at the start of the connection to make this authed let mut db = db.clone(); tokio::spawn(async move { - loop { - let Ok(msg_len) = socket.read_u32_le().await else { break }; + while let Ok(msg_len) = socket.read_u32_le().await { let mut buf = vec![0; usize::try_from(msg_len).unwrap()]; let Ok(_) = socket.read_exact(&mut buf).await else { break }; let msg = borsh::from_slice(&buf).unwrap(); diff --git a/networks/ethereum/relayer/src/main.rs b/networks/ethereum/relayer/src/main.rs index 6424c90f..5d135a6c 100644 --- a/networks/ethereum/relayer/src/main.rs +++ b/networks/ethereum/relayer/src/main.rs @@ -53,8 +53,7 @@ async fn main() { let db = db.clone(); tokio::spawn(async move { let mut db = db.clone(); - loop { - let Ok(msg_len) = socket.read_u32_le().await else { break }; + while let Ok(msg_len) = socket.read_u32_le().await { let mut buf = vec![0; usize::try_from(msg_len).unwrap()]; let Ok(_) = socket.read_exact(&mut buf).await else { break }; diff --git a/patches/home/Cargo.toml b/patches/home/Cargo.toml new file mode 100644 index 00000000..4bc17ec7 --- /dev/null +++ b/patches/home/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "home" +version = "0.5.99" +description = "Replacement for `home` which uses the `std` impl" +license = "MIT" +repository = "https://github.com/serai-dex/serai/tree/develop/patches/home" +authors = ["Luke Parker "] +keywords = [] +edition = "2024" +rust-version = "1.85" + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + +[workspace] diff --git a/patches/home/src/lib.rs b/patches/home/src/lib.rs new file mode 100644 index 00000000..fdc36542 --- /dev/null +++ b/patches/home/src/lib.rs @@ -0,0 +1 @@ +pub use std::env::home_dir;