[INFO] cloning repository https://github.com/dimerz-tech/codecrafters-bittorrent-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/dimerz-tech/codecrafters-bittorrent-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdimerz-tech%2Fcodecrafters-bittorrent-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdimerz-tech%2Fcodecrafters-bittorrent-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] a821ed5f4b5ab71b0877cff0143eeeb9130b0968 [INFO] building dimerz-tech/codecrafters-bittorrent-rust against try#9a3ef2cd3ecaae3c6ef59768612837d797602a6d for pr-137044-3 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdimerz-tech%2Fcodecrafters-bittorrent-rust" "/workspace/builds/worker-0-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/dimerz-tech/codecrafters-bittorrent-rust on toolchain 9a3ef2cd3ecaae3c6ef59768612837d797602a6d [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+9a3ef2cd3ecaae3c6ef59768612837d797602a6d" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/dimerz-tech/codecrafters-bittorrent-rust [INFO] finished tweaking git repo https://github.com/dimerz-tech/codecrafters-bittorrent-rust [INFO] tweaked toml for git repo https://github.com/dimerz-tech/codecrafters-bittorrent-rust written to /workspace/builds/worker-0-tc2/source/Cargo.toml [INFO] crate git repo https://github.com/dimerz-tech/codecrafters-bittorrent-rust already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+9a3ef2cd3ecaae3c6ef59768612837d797602a6d" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:3959728d45483eb673ba100a951a6b9f5012970368db2a9e08e0ac9b67c8a5ad" "/opt/rustwide/cargo-home/bin/cargo" "+9a3ef2cd3ecaae3c6ef59768612837d797602a6d" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 1da665c8a7eef97d90f7cf706838a55c4f6a5e73b88c6bfa9e617f3ee2600247 [INFO] running `Command { std: "docker" "start" "-a" "1da665c8a7eef97d90f7cf706838a55c4f6a5e73b88c6bfa9e617f3ee2600247", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "1da665c8a7eef97d90f7cf706838a55c4f6a5e73b88c6bfa9e617f3ee2600247", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1da665c8a7eef97d90f7cf706838a55c4f6a5e73b88c6bfa9e617f3ee2600247", kill_on_drop: false }` [INFO] [stdout] 1da665c8a7eef97d90f7cf706838a55c4f6a5e73b88c6bfa9e617f3ee2600247 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:3959728d45483eb673ba100a951a6b9f5012970368db2a9e08e0ac9b67c8a5ad" "/opt/rustwide/cargo-home/bin/cargo" "+9a3ef2cd3ecaae3c6ef59768612837d797602a6d" "build" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] cbc4a620b1958f6a3f80d51f6b2e1a39ca0798b239b9312f371410d549a8d9f1 [INFO] running `Command { std: "docker" "start" "-a" "cbc4a620b1958f6a3f80d51f6b2e1a39ca0798b239b9312f371410d549a8d9f1", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.147 [INFO] [stderr] Compiling proc-macro2 v1.0.66 [INFO] [stderr] Compiling unicode-ident v1.0.11 [INFO] [stderr] Compiling autocfg v1.1.0 [INFO] [stderr] Compiling once_cell v1.18.0 [INFO] [stderr] Compiling pin-project-lite v0.2.12 [INFO] [stderr] Compiling memchr v2.5.0 [INFO] [stderr] Compiling pkg-config v0.3.27 [INFO] [stderr] Compiling parking_lot_core v0.9.8 [INFO] [stderr] Compiling vcpkg v0.2.15 [INFO] [stderr] Compiling futures-core v0.3.28 [INFO] [stderr] Compiling smallvec v1.11.0 [INFO] [stderr] Compiling bytes v1.3.0 [INFO] [stderr] Compiling lock_api v0.4.10 [INFO] [stderr] Compiling itoa v1.0.9 [INFO] [stderr] Compiling slab v0.4.8 [INFO] [stderr] Compiling typenum v1.16.0 [INFO] [stderr] Compiling version_check v0.9.4 [INFO] [stderr] Compiling serde v1.0.183 [INFO] [stderr] Compiling quote v1.0.33 [INFO] [stderr] Compiling futures-task v0.3.28 [INFO] [stderr] Compiling cc v1.0.82 [INFO] [stderr] Compiling num_cpus v1.16.0 [INFO] [stderr] Compiling syn v2.0.29 [INFO] [stderr] Compiling socket2 v0.5.3 [INFO] [stderr] Compiling mio v0.8.8 [INFO] [stderr] Compiling signal-hook-registry v1.4.1 [INFO] [stderr] Compiling rustix v0.38.8 [INFO] [stderr] Compiling parking_lot v0.12.1 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Compiling indexmap v1.9.3 [INFO] [stderr] Compiling tracing-core v0.1.31 [INFO] [stderr] Compiling linux-raw-sys v0.4.5 [INFO] [stderr] Compiling foreign-types-shared v0.1.1 [INFO] [stderr] Compiling bitflags v2.4.0 [INFO] [stderr] Compiling futures-util v0.3.28 [INFO] [stderr] Compiling serde_derive v1.0.183 [INFO] [stderr] Compiling openssl v0.10.56 [INFO] [stderr] Compiling http v0.2.9 [INFO] [stderr] Compiling foreign-types v0.3.2 [INFO] [stderr] Compiling tracing v0.1.37 [INFO] [stderr] Compiling futures-io v0.3.28 [INFO] [stderr] Compiling openssl-sys v0.9.91 [INFO] [stderr] Compiling futures-sink v0.3.28 [INFO] [stderr] Compiling native-tls v0.2.11 [INFO] [stderr] Compiling bitflags v1.3.2 [INFO] [stderr] Compiling futures-channel v0.3.28 [INFO] [stderr] Compiling httparse v1.8.0 [INFO] [stderr] Compiling tinyvec v1.6.0 [INFO] [stderr] Compiling syn v1.0.48 [INFO] [stderr] Compiling percent-encoding v2.3.0 [INFO] [stderr] Compiling openssl-probe v0.1.5 [INFO] [stderr] Compiling try-lock v0.2.4 [INFO] [stderr] Compiling log v0.4.20 [INFO] [stderr] Compiling utf8parse v0.2.1 [INFO] [stderr] Compiling anstyle-parse v0.2.1 [INFO] [stderr] Compiling want v0.3.1 [INFO] [stderr] Compiling is-terminal v0.4.9 [INFO] [stderr] Compiling form_urlencoded v1.2.0 [INFO] [stderr] Compiling unicode-normalization v0.1.22 [INFO] [stderr] Compiling http-body v0.4.5 [INFO] [stderr] Compiling socket2 v0.4.9 [INFO] [stderr] Compiling anstyle v1.0.1 [INFO] [stderr] Compiling unicode-xid v0.2.1 [INFO] [stderr] Compiling tower-service v0.3.2 [INFO] [stderr] Compiling serde_json v1.0.105 [INFO] [stderr] Compiling colorchoice v1.0.0 [INFO] [stderr] Compiling unicode-bidi v0.3.13 [INFO] [stderr] Compiling ryu v1.0.15 [INFO] [stderr] Compiling anstyle-query v1.0.0 [INFO] [stderr] Compiling anstream v0.3.2 [INFO] [stderr] Compiling crypto-common v0.1.6 [INFO] [stderr] Compiling block-buffer v0.10.4 [INFO] [stderr] Compiling aho-corasick v1.0.4 [INFO] [stderr] Compiling anyhow v1.0.68 [INFO] [stderr] Compiling idna v0.4.0 [INFO] [stderr] Compiling regex-syntax v0.7.4 [INFO] [stderr] Compiling heck v0.4.1 [INFO] [stderr] Compiling clap_lex v0.5.0 [INFO] [stderr] Compiling strsim v0.10.0 [INFO] [stderr] Compiling thiserror v1.0.38 [INFO] [stderr] Compiling url v2.4.0 [INFO] [stderr] Compiling clap_builder v4.3.22 [INFO] [stderr] Compiling tokio-macros v2.1.0 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling serde_bytes v0.11.12 [INFO] [stderr] Compiling serde_urlencoded v0.7.1 [INFO] [stderr] Compiling tokio v1.32.0 [INFO] [stderr] Compiling clap_derive v4.3.12 [INFO] [stderr] Compiling thiserror-impl v1.0.38 [INFO] [stderr] Compiling digest v0.10.7 [INFO] [stderr] Compiling regex-automata v0.3.6 [INFO] [stderr] Compiling encoding_rs v0.8.32 [INFO] [stderr] Compiling fastrand v2.0.0 [INFO] [stderr] Compiling cpufeatures v0.2.9 [INFO] [stderr] Compiling ipnet v2.8.0 [INFO] [stderr] Compiling base64 v0.21.2 [INFO] [stderr] Compiling clap v4.3.22 [INFO] [stderr] Compiling sha1 v0.10.5 [INFO] [stderr] Compiling tempfile v3.7.1 [INFO] [stderr] Compiling serde_bencode v0.2.3 [INFO] [stderr] Compiling regex v1.9.3 [INFO] [stderr] Compiling tokio-util v0.7.8 [INFO] [stderr] Compiling tokio-native-tls v0.3.1 [INFO] [stderr] Compiling h2 v0.3.20 [INFO] [stderr] Compiling hyper v0.14.27 [INFO] [stderr] Compiling hyper-tls v0.5.0 [INFO] [stderr] Compiling reqwest v0.11.18 [INFO] [stderr] Compiling bittorrent-starter-rust v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused imports: `Deserialize` and `Serialize` [INFO] [stdout] --> src/main.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | use serde::{Deserialize, Serialize}; [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `u16` [INFO] [stdout] --> src/main.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | use u16; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/peer.rs:62:21 [INFO] [stdout] | [INFO] [stdout] 62 | if let Some(mut session) = self.session.as_mut() { [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `piece_num` [INFO] [stdout] --> src/peer.rs:76:40 [INFO] [stdout] | [INFO] [stdout] 76 | pub async fn load_piece(&mut self, piece_num: usize) -> anyhow::Result<()> { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_piece_num` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `clap::builder::TypedValueParser` [INFO] [stdout] --> src/peer.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use clap::builder::TypedValueParser; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `piece_path` [INFO] [stdout] --> src/main.rs:170:13 [INFO] [stdout] | [INFO] [stdout] 170 | let piece_path = &args[3]; [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_piece_path` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `connect_peer` is never used [INFO] [stdout] --> src/main.rs:49:10 [INFO] [stdout] | [INFO] [stdout] 49 | async fn connect_peer(peer: &str) -> TcpStream { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `send_interested` is never used [INFO] [stdout] --> src/main.rs:54:10 [INFO] [stdout] | [INFO] [stdout] 54 | async fn send_interested(stream: &mut TcpStream) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_unchoke` is never used [INFO] [stdout] --> src/main.rs:60:10 [INFO] [stdout] | [INFO] [stdout] 60 | async fn get_unchoke(stream: &mut TcpStream) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `block_request` is never used [INFO] [stdout] --> src/main.rs:68:10 [INFO] [stdout] | [INFO] [stdout] 68 | async fn block_request(stream: &mut TcpStream, piece: i32, position: i32, block: i32) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `block_response` is never used [INFO] [stdout] --> src/main.rs:82:10 [INFO] [stdout] | [INFO] [stdout] 82 | async fn block_response(stream: &mut TcpStream, index: i32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `load_piece` is never used [INFO] [stdout] --> src/main.rs:98:10 [INFO] [stdout] | [INFO] [stdout] 98 | async fn load_piece(stream: &mut TcpStream, piece: i32, torrent: &Torrent) -> Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `write_file` is never used [INFO] [stdout] --> src/main.rs:125:10 [INFO] [stdout] | [INFO] [stdout] 125 | async fn write_file(path: &String, data: &Vec) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `complete`, `incomplete`, `interval`, and `min_interval` are never read [INFO] [stdout] --> src/tracker.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 27 | struct TrackerResponse { [INFO] [stdout] | --------------- fields in this struct [INFO] [stdout] 28 | // number of peers with the entire file, i.e. seeders (integer) [INFO] [stdout] 29 | pub complete: usize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 30 | // number of non-seeder peers, aka "leechers" (integer) [INFO] [stdout] 31 | pub incomplete: usize, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 32 | // Interval in seconds that the client should wait between sending regular requests to the tracker [INFO] [stdout] 33 | pub interval: usize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | pub min_interval: usize, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TrackerResponse` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `pieces` is never read [INFO] [stdout] --> src/peer.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct Peer { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] ... [INFO] [stdout] 13 | pub pieces: Vec, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `pstrlen`, `pstr`, `reserved`, and `info_hash` are never read [INFO] [stdout] --> src/peer.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 85 | pub struct HandShake { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 86 | // string length of , as a single raw byte [INFO] [stdout] 87 | pstrlen: [u8; 1], [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 88 | // string identifier of the protocol [INFO] [stdout] 89 | pstr: [u8; 19], [INFO] [stdout] | ^^^^ [INFO] [stdout] 90 | // eight (8) reserved bytes. All current implementations use all zeroes [INFO] [stdout] 91 | reserved: [u8; 8], [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 92 | // 20-byte SHA1 hash of the info key in the metainfo file [INFO] [stdout] 93 | info_hash: [u8; 20], [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `HandShake` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `PeerMessage` is never constructed [INFO] [stdout] --> src/peer.rs:128:8 [INFO] [stdout] | [INFO] [stdout] 128 | struct PeerMessage { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `hash` and `length` are never read [INFO] [stdout] --> src/piece.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 2 | pub struct Piece { [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] 3 | pub hash: Vec, [INFO] [stdout] | ^^^^ [INFO] [stdout] 4 | pub length: i32 [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `X` should have a snake case name [INFO] [stdout] --> src/peer.rs:64:17 [INFO] [stdout] | [INFO] [stdout] 64 | let X = u32::from_be_bytes(len) - 1; [INFO] [stdout] | ^ help: convert the identifier to snake case (notice the capitalization): `x` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 38s [INFO] running `Command { std: "docker" "inspect" "cbc4a620b1958f6a3f80d51f6b2e1a39ca0798b239b9312f371410d549a8d9f1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "cbc4a620b1958f6a3f80d51f6b2e1a39ca0798b239b9312f371410d549a8d9f1", kill_on_drop: false }` [INFO] [stdout] cbc4a620b1958f6a3f80d51f6b2e1a39ca0798b239b9312f371410d549a8d9f1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:3959728d45483eb673ba100a951a6b9f5012970368db2a9e08e0ac9b67c8a5ad" "/opt/rustwide/cargo-home/bin/cargo" "+9a3ef2cd3ecaae3c6ef59768612837d797602a6d" "test" "--frozen" "--no-run" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 48652be71906c2e5117b1c85ec9ea078e82c72f13946ed0ac0ce8fff70fcc41e [INFO] running `Command { std: "docker" "start" "-a" "48652be71906c2e5117b1c85ec9ea078e82c72f13946ed0ac0ce8fff70fcc41e", kill_on_drop: false }` [INFO] [stderr] Compiling bittorrent-starter-rust v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused imports: `Deserialize` and `Serialize` [INFO] [stdout] --> src/main.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | use serde::{Deserialize, Serialize}; [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `u16` [INFO] [stdout] --> src/main.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | use u16; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/peer.rs:62:21 [INFO] [stdout] | [INFO] [stdout] 62 | if let Some(mut session) = self.session.as_mut() { [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `piece_num` [INFO] [stdout] --> src/peer.rs:76:40 [INFO] [stdout] | [INFO] [stdout] 76 | pub async fn load_piece(&mut self, piece_num: usize) -> anyhow::Result<()> { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_piece_num` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `clap::builder::TypedValueParser` [INFO] [stdout] --> src/peer.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use clap::builder::TypedValueParser; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `piece_path` [INFO] [stdout] --> src/main.rs:170:13 [INFO] [stdout] | [INFO] [stdout] 170 | let piece_path = &args[3]; [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_piece_path` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `connect_peer` is never used [INFO] [stdout] --> src/main.rs:49:10 [INFO] [stdout] | [INFO] [stdout] 49 | async fn connect_peer(peer: &str) -> TcpStream { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `send_interested` is never used [INFO] [stdout] --> src/main.rs:54:10 [INFO] [stdout] | [INFO] [stdout] 54 | async fn send_interested(stream: &mut TcpStream) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_unchoke` is never used [INFO] [stdout] --> src/main.rs:60:10 [INFO] [stdout] | [INFO] [stdout] 60 | async fn get_unchoke(stream: &mut TcpStream) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `block_request` is never used [INFO] [stdout] --> src/main.rs:68:10 [INFO] [stdout] | [INFO] [stdout] 68 | async fn block_request(stream: &mut TcpStream, piece: i32, position: i32, block: i32) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `block_response` is never used [INFO] [stdout] --> src/main.rs:82:10 [INFO] [stdout] | [INFO] [stdout] 82 | async fn block_response(stream: &mut TcpStream, index: i32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `load_piece` is never used [INFO] [stdout] --> src/main.rs:98:10 [INFO] [stdout] | [INFO] [stdout] 98 | async fn load_piece(stream: &mut TcpStream, piece: i32, torrent: &Torrent) -> Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `write_file` is never used [INFO] [stdout] --> src/main.rs:125:10 [INFO] [stdout] | [INFO] [stdout] 125 | async fn write_file(path: &String, data: &Vec) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `complete`, `incomplete`, `interval`, and `min_interval` are never read [INFO] [stdout] --> src/tracker.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 27 | struct TrackerResponse { [INFO] [stdout] | --------------- fields in this struct [INFO] [stdout] 28 | // number of peers with the entire file, i.e. seeders (integer) [INFO] [stdout] 29 | pub complete: usize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 30 | // number of non-seeder peers, aka "leechers" (integer) [INFO] [stdout] 31 | pub incomplete: usize, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 32 | // Interval in seconds that the client should wait between sending regular requests to the tracker [INFO] [stdout] 33 | pub interval: usize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | pub min_interval: usize, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TrackerResponse` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `pieces` is never read [INFO] [stdout] --> src/peer.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct Peer { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] ... [INFO] [stdout] 13 | pub pieces: Vec, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `pstrlen`, `pstr`, `reserved`, and `info_hash` are never read [INFO] [stdout] --> src/peer.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 85 | pub struct HandShake { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 86 | // string length of , as a single raw byte [INFO] [stdout] 87 | pstrlen: [u8; 1], [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 88 | // string identifier of the protocol [INFO] [stdout] 89 | pstr: [u8; 19], [INFO] [stdout] | ^^^^ [INFO] [stdout] 90 | // eight (8) reserved bytes. All current implementations use all zeroes [INFO] [stdout] 91 | reserved: [u8; 8], [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 92 | // 20-byte SHA1 hash of the info key in the metainfo file [INFO] [stdout] 93 | info_hash: [u8; 20], [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `HandShake` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `PeerMessage` is never constructed [INFO] [stdout] --> src/peer.rs:128:8 [INFO] [stdout] | [INFO] [stdout] 128 | struct PeerMessage { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `hash` and `length` are never read [INFO] [stdout] --> src/piece.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 2 | pub struct Piece { [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] 3 | pub hash: Vec, [INFO] [stdout] | ^^^^ [INFO] [stdout] 4 | pub length: i32 [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `X` should have a snake case name [INFO] [stdout] --> src/peer.rs:64:17 [INFO] [stdout] | [INFO] [stdout] 64 | let X = u32::from_be_bytes(len) - 1; [INFO] [stdout] | ^ help: convert the identifier to snake case (notice the capitalization): `x` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 1.19s [INFO] running `Command { std: "docker" "inspect" "48652be71906c2e5117b1c85ec9ea078e82c72f13946ed0ac0ce8fff70fcc41e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "48652be71906c2e5117b1c85ec9ea078e82c72f13946ed0ac0ce8fff70fcc41e", kill_on_drop: false }` [INFO] [stdout] 48652be71906c2e5117b1c85ec9ea078e82c72f13946ed0ac0ce8fff70fcc41e