From 0f758dfc9505355107d6ef83964eb940a7a2c8f7 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 00:07:00 +0000 Subject: [PATCH 1/3] ci: disable use-flakehub on magic-nix-cache to resolve action failure Co-authored-by: dezren39 <11225574+dezren39@users.noreply.github.com> --- .github/workflows/id-bench.yml | 2 ++ .github/workflows/id-check.yml | 4 ++++ .github/workflows/id-e2e-nightly.yml | 2 ++ .github/workflows/mcpx-nixbuild.yml | 2 ++ 4 files changed, 10 insertions(+) diff --git a/.github/workflows/id-bench.yml b/.github/workflows/id-bench.yml index d5879f8044..521dd6bad5 100644 --- a/.github/workflows/id-bench.yml +++ b/.github/workflows/id-bench.yml @@ -54,6 +54,8 @@ jobs: # Same store cache as the PR gate, so the bench build starts warm # (#288). - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + with: + use-flakehub: false # Full-size workloads, exactly as the baselines were taken # (BASELINES.md): --quick numbers are smoke sizes and are never diff --git a/.github/workflows/id-check.yml b/.github/workflows/id-check.yml index f9bdd2a720..21b0239cb6 100644 --- a/.github/workflows/id-check.yml +++ b/.github/workflows/id-check.yml @@ -143,6 +143,8 @@ jobs: # Cache the nix store on GitHub's cache so PRs do not rebuild # unchanged derivations from a cold store every run (#288). - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + with: + use-flakehub: false # Enable KVM for NixOS VM integration tests - name: Enable KVM @@ -192,6 +194,8 @@ jobs: extra-conf: | accept-flake-config = true - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + with: + use-flakehub: false - name: Enable KVM run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules diff --git a/.github/workflows/id-e2e-nightly.yml b/.github/workflows/id-e2e-nightly.yml index b11039d569..9712171a4d 100644 --- a/.github/workflows/id-e2e-nightly.yml +++ b/.github/workflows/id-e2e-nightly.yml @@ -41,6 +41,8 @@ jobs: # Same store cache as the PR gate, so the nightly run starts warm # and unchanged derivations are not rebuilt from cold (#288). - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + with: + use-flakehub: false # Enable KVM for NixOS VM integration tests - name: Enable KVM diff --git a/.github/workflows/mcpx-nixbuild.yml b/.github/workflows/mcpx-nixbuild.yml index 68ab837ecf..54c392bd0e 100644 --- a/.github/workflows/mcpx-nixbuild.yml +++ b/.github/workflows/mcpx-nixbuild.yml @@ -60,6 +60,8 @@ jobs: # Warm store: dependency-bump PRs are rare, but when they come the # build should not start from cold (#288). - uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15 + with: + use-flakehub: false - name: Nix build run: nix build .#packages.x86_64-linux.mcpx --print-build-logs From 7211a0eb7158a9a79e1d11f3c8140aad0aedda19 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 00:31:26 +0000 Subject: [PATCH 2/3] ci: fix FlakeHub registration required error in actions cache Co-authored-by: dezren39 <11225574+dezren39@users.noreply.github.com> From 1646db173565ddc8553754e5ce182ba30d9ac279 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 02:51:38 +0000 Subject: [PATCH 3/3] style(id): resolve clippy-lint check failures in CI Co-authored-by: dezren39 <11225574+dezren39@users.noreply.github.com> --- pkgs/id/clippy_out4.txt | 6147 ++++++++++++++++++++++++++++++++++++ pkgs/id/clippy_out5.txt | 5161 ++++++++++++++++++++++++++++++ pkgs/id/src/tags.rs | 4 +- pkgs/id/src/web/routes.rs | 2 +- pkgs/id/src/world_ssh.rs | 8 +- pkgs/id/src/world_store.rs | 2 +- plan.md | 21 + 7 files changed, 11337 insertions(+), 8 deletions(-) create mode 100644 pkgs/id/clippy_out4.txt create mode 100644 pkgs/id/clippy_out5.txt create mode 100644 plan.md diff --git a/pkgs/id/clippy_out4.txt b/pkgs/id/clippy_out4.txt new file mode 100644 index 0000000000..fd7e8c0be6 --- /dev/null +++ b/pkgs/id/clippy_out4.txt @@ -0,0 +1,6147 @@ + Checking id v0.1.0 (/app/pkgs/id) +warning: empty line after doc comment + --> src/commands/find.rs:212:1 + | +212 | / /// +213 | | + | |_^ +... +223 | pub async fn cmd_find( + | --------------------- the comment documents this function + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#empty_line_after_doc_comments + = note: `-W clippy::empty-line-after-doc-comments` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::empty_line_after_doc_comments)]` + = help: if the empty line is unintentional, remove it +help: if the documentation should include the empty line include it in the comment + | +213 | /// + | + +warning: unused import: `MatchKind` + --> src/commands/repl.rs:98:44 + | +98 | CLIENT_KEY_FILE, FindMatch, META_ALPN, MatchKind, MetaRequest, MetaR... + | ^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unnecessary qualification + --> src/commands/world.rs:1088:33 + | +1088 | let mut paths: Vec<(String, std::path::PathBuf)> = Vec::new(); + | ^^^^^^^^^^^^^^^^^^ + | + = note: requested on the command line with `-W unused-qualifications` +help: remove the unnecessary path segments + | +1088 - let mut paths: Vec<(String, std::path::PathBuf)> = Vec::new(); +1088 + let mut paths: Vec<(String, PathBuf)> = Vec::new(); + | + +warning: unnecessary qualification + --> src/commands/world.rs:1091:31 + | +1091 | ... let mut siblings: Vec = std::fs::read_dir(so... + | ^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1091 - let mut siblings: Vec = std::fs::read_dir(source) +1091 + let mut siblings: Vec = std::fs::read_dir(source) + | + +warning: unnecessary qualification + --> src/world_doctor.rs:202:9 + | +202 | std::path::Path::new(roc_bin).is_file() + | ^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +202 - std::path::Path::new(roc_bin).is_file() +202 + Path::new(roc_bin).is_file() + | + +warning: you matched a field with a wildcard pattern, consider using `..` instead + --> src/world_doctor.rs:374:17 + | +374 | world_id: _, + | ^^^^^^^^^^^ + | + = help: try with `Created { version: created_version, .. }` + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unneeded_field_pattern + = note: requested on the command line with `-W clippy::unneeded-field-pattern` + +warning: unused import: `CompileFile` + --> src/world_session/mod.rs:54:39 + | +54 | CAPS_CEILING_NOTICE, ClientFrame, CompileFile, MAX_ADMIN_TOKEN_BYTES... + | ^^^^^^^^^^^ + +warning: unnecessary qualification + --> src/world_session/mod.rs:691:19 + | +691 | let hash: iroh_blobs::Hash = expected_hash + | ^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +691 - let hash: iroh_blobs::Hash = expected_hash +691 + let hash: Hash = expected_hash + | + +warning: unused import: `JOURNAL_VERSION_EXECUTION_PROFILE` + --> src/world_store.rs:31:22 + | +31 | JOURNAL_VERSION, JOURNAL_VERSION_EXECUTION_PROFILE, JournalEntry, Wo... + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: empty line after doc comment + --> src/web/markdown.rs:2394:1 + | +2394 | / /// shared-mark case; non-chain children keep the original merge. +2395 | | + | |_^ +... +2415 | fn adopt_trailing_html_atoms<'a>(parent: &'a AstNode<'a>, wrappers: ... + | ---------------------------- the comment documents this function + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#empty_line_after_doc_comments + = help: if the empty line is unintentional, remove it +help: if the documentation should include the empty line include it in the comment + | +2395 | /// + | + +warning: long literal lacking separators + --> src/cli.rs:4336:48 + | +4336 | assert_eq!(wasm_fuel, Some(500000)); + | ^^^^^^ help: consider: `500_000` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unreadable_literal + = note: `-W clippy::unreadable-literal` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::unreadable_literal)]` + +warning: long literal lacking separators + --> src/cli.rs:4337:56 + | +4337 | assert_eq!(wasm_memory_bytes, Some(16777216)); + | ^^^^^^^^ help: consider: `16_777_216` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unreadable_literal + +warning: binding's name is too similar to existing binding + --> src/event_store/sync.rs:788:14 + | +788 | ... let (dialed, accepted) = tokio::time::timeout(Duration::from_secs... + | ^^^^^^ + | +note: existing binding defined here + --> src/event_store/sync.rs:762:9 + | +762 | dialer: SecretKey, + | ^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#similar_names + = note: `-W clippy::similar-names` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::similar_names)]` + +warning: unnecessary qualification + --> src/log_sync.rs:841:15 + | +841 | ... match tokio::time::timeout(std::time::Duration::from_secs(10), re... + | ^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +841 - match tokio::time::timeout(std::time::Duration::from_secs(10), results.recv()).await { +841 + match timeout(std::time::Duration::from_secs(10), results.recv()).await { + | + +warning: unnecessary qualification + --> src/log_sync.rs:841:36 + | +841 | ... match tokio::time::timeout(std::time::Duration::from_secs(10), re... + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +841 - match tokio::time::timeout(std::time::Duration::from_secs(10), results.recv()).await { +841 + match tokio::time::timeout(Duration::from_secs(10), results.recv()).await { + | + +warning: binding's name is too similar to existing binding + --> src/meta_client.rs:232:13 + | +232 | let served = serve_once(server.clone(), payload); + | ^^^^^^ + | +note: existing binding defined here + --> src/meta_client.rs:230:13 + | +230 | let server = endpoint(vec![TEST_ALPN.to_vec()]).await.unwrap(); + | ^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#similar_names + +warning: `mod.rs` files are required, found `src/shell_contract.rs` + --> src/shell_contract.rs:1:1 + | +1 | //! The versioned shell contract (F13.1). + | ^ + | + = help: move `src/shell_contract.rs` to `src/shell_contract/mod.rs` + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#self_named_module_files + = note: requested on the command line with `-W clippy::self-named-module-files` + +warning: unused import: `crate::world::*` + --> src/world/tests.rs:2505:9 + | +2505 | use crate::world::*; + | ^^^^^^^^^^^^^^^ + +warning: unused import: `crate::world::*` + --> src/world/tests.rs:2775:9 + | +2775 | use crate::world::*; + | ^^^^^^^^^^^^^^^ + +warning: unused import: `crate::world::*` + --> src/world/tests.rs:3137:9 + | +3137 | use crate::world::*; + | ^^^^^^^^^^^^^^^ + +warning: unnecessary qualification + --> src/world_compile.rs:1319:9 + | +1319 | crate::world_compile::locate_roc() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1319 - crate::world_compile::locate_roc() +1319 + locate_roc() + | + +warning: unnecessary hashes around raw string literal + --> src/world_fixture.rs:1074:39 + | +1074 | let second = vec![snapshot(2, r#"{}"#)]; + | ^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_raw_string_hashes + = note: `-W clippy::needless-raw-string-hashes` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_raw_string_hashes)]` +help: remove all the hashes around the string literal + | +1074 - let second = vec![snapshot(2, r#"{}"#)]; +1074 + let second = vec![snapshot(2, r"{}")]; + | + +warning: unused import: `super::*` + --> src/world_session/tests.rs:7:9 + | +7 | use super::*; + | ^^^^^^^^ + +warning: unnecessary qualification + --> src/world_ssh.rs:2682:18 + | +2682 | Some(russh::ChannelMsg::Failure) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2682 - Some(russh::ChannelMsg::Failure) +2682 + Some(ChannelMsg::Failure) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2688:18 + | +2688 | Some(russh::ChannelMsg::Success) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2688 - Some(russh::ChannelMsg::Success) +2688 + Some(ChannelMsg::Success) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2694:18 + | +2694 | Some(russh::ChannelMsg::Failure) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2694 - Some(russh::ChannelMsg::Failure) +2694 + Some(ChannelMsg::Failure) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2705:26 + | +2705 | ... Some(russh::ChannelMsg::Eof | russh::ChannelMsg::Close) | None =... + | ^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2705 - Some(russh::ChannelMsg::Eof | russh::ChannelMsg::Close) | None => break, +2705 + Some(ChannelMsg::Eof | russh::ChannelMsg::Close) | None => break, + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2705:51 + | +2705 | ... Some(russh::ChannelMsg::Eof | russh::ChannelMsg::Close) | None =... + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2705 - Some(russh::ChannelMsg::Eof | russh::ChannelMsg::Close) | None => break, +2705 + Some(russh::ChannelMsg::Eof | ChannelMsg::Close) | None => break, + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2754:18 + | +2754 | Some(russh::ChannelMsg::Success) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2754 - Some(russh::ChannelMsg::Success) +2754 + Some(ChannelMsg::Success) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2762:17 + | +2762 | crate::frames::encode_frame(join.as_bytes()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2762 - crate::frames::encode_frame(join.as_bytes()) +2762 + encode_frame(join.as_bytes()) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2768:26 + | +2768 | let mut buffer = crate::frames::FrameBuffer::default(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2768 - let mut buffer = crate::frames::FrameBuffer::default(); +2768 + let mut buffer = FrameBuffer::default(); + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2772:26 + | +2772 | Some(russh::ChannelMsg::Data { data }) => { + | ^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2772 - Some(russh::ChannelMsg::Data { data }) => { +2772 + Some(ChannelMsg::Data { data }) => { + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2774:37 + | +2774 | ... if let Some(crate::frames::Decoded::Frame(body)) = buffer.next_f... + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2774 - if let Some(crate::frames::Decoded::Frame(body)) = buffer.next_frame() { +2774 + if let Some(Decoded::Frame(body)) = buffer.next_frame() { + | + +warning: unnecessary qualification + --> src/world_store.rs:1442:23 + | +1442 | kind: crate::world::WorldEventKind::ProgramInstalled { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1442 - kind: crate::world::WorldEventKind::ProgramInstalled { +1442 + kind: WorldEventKind::ProgramInstalled { + | + +warning: unnecessary qualification + --> src/world_store.rs:1510:17 + | +1510 | crate::world::Authority::Admin, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1510 - crate::world::Authority::Admin, +1510 + Authority::Admin, + | + +warning: unnecessary qualification + --> src/world_store.rs:1511:17 + | +1511 | crate::world::Isolation::Unisolated, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1511 - crate::world::Isolation::Unisolated, +1511 + Isolation::Unisolated, + | + +warning: unnecessary qualification + --> src/web/routes.rs:2468:66 + | +2468 | ... &str) -> (StatusCode, axum::http::HeaderMap, Vec) { + | ^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2468 - async fn get_blob(router: Router, uri: &str) -> (StatusCode, axum::http::HeaderMap, Vec) { +2468 + async fn get_blob(router: Router, uri: &str) -> (StatusCode, HeaderMap, Vec) { + | + +warning: unnecessary qualification + --> src/web/routes.rs:2485:36 + | +2485 | fn header_str<'a>(headers: &'a axum::http::HeaderMap, name: &str) ... + | ^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2485 - fn header_str<'a>(headers: &'a axum::http::HeaderMap, name: &str) -> Option<&'a str> { +2485 + fn header_str<'a>(headers: &'a HeaderMap, name: &str) -> Option<&'a str> { + | + +warning: method `keeps` is never used + --> src/event_store/ingest.rs:468:8 + | +466 | impl Staged { + | ----------- method in this implementation +467 | /// Whether the event ... +468 | fn keeps(&self) -> bool { + | ^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: function `collect_list_items` is never used + --> src/web/markdown.rs:824:4 + | +824 | fn collect_list_items<'a>(node: &'a AstNode<'a>) -> Vec { + | ^^^^^^^^^^^^^^^^^^ + +warning: binding's name is too similar to existing binding + --> src/web/world_ws.rs:1203:13 + | +1203 | let compiled = next_frame(&mut uploader).await.unwrap(); + | ^^^^^^^^ + | +note: existing binding defined here + --> src/web/world_ws.rs:1169:13 + | +1169 | ... let compiler = crate::world_compile::Compiler::new(platform_dir,... + | ^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#similar_names + +warning: first doc comment paragraph is too long + --> src/aliases.rs:114:1 + | +114 | / /// The rows of a view over `named`, with the rules above. `primary_a... +115 | | /// server's stored primary alias for them, if this server keeps one.... +116 | | /// to the owner's pet name for it. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + = note: `-W clippy::too-long-first-doc-paragraph` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::too_long_first_doc_paragraph)]` + +warning: these match arms have identical bodies + --> src/chain.rs:240:13 + | +240 | (false, None) => {} + | ^^^^^^^^^^^^^^^^^^^ +... +253 | (true, Some(_)) => {} + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms + = note: `-W clippy::match-same-arms` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::match_same_arms)]` +help: otherwise merge the patterns into a single arm + | +240 ~ (false, Some(_)) => { +241 | return Err(ChainError::Extension(format!( +... +251 | } +252 ~ (false, None) | (true, Some(_)) => {} + | + +warning: large size difference between variants + --> src/cli.rs:200:1 + | + 200 | / pub enum Command { + 201 | | /// Start a server that accepts put/get requests from peers. + 202 | | /// + 203 | | /// The server runs indefinitely, hosting stored blobs and acc... +... | + 243 | | / Serve { + 244 | | | /// Use in-memory storage instead of persistent disk storage. + 245 | | | /// + 246 | | | /// Content is lost when the server stops. Useful for testing +... | | + 470 | | | open_writes: bool, + 471 | | | }, + | | |_____- the largest variant contains at least 543 bytes +... | + 867 | | / Find { + 868 | | | /// Search queries (case-insensitive). + 869 | | | /// + 870 | | | /// Multiple queries find the best match for each. +... | | + 909 | | | no_relay: bool, + 910 | | | }, + | | |_____- the second-largest variant contains at least 157 bytes +... | +1247 | | }, +1248 | | } + | |___^ the entire enum is at least 544 bytes + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#large_enum_variant + = note: `-W clippy::large-enum-variant` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::large_enum_variant)]` +help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum + | + 381 ~ world_mail_smtp: Box>, + 382 | /// Sender address for mail sent with `--world-mail-smtp`. + ... + 434 | #[command(flatten)] + 435 ~ world_runtime: Box, + 436 | /// Capability the default world's program may use (repeatable; `*` + ... + 443 | #[arg(long, default_value = "deny", requires = "world")] + 444 ~ world_cap_policy: Box, + 445 | /// Capabilities the server allows any world to use, comma-separated + ... + 448 | #[arg(long, value_name = "NAMES", value_delimiter = ',', requires = "world")] + 449 ~ world_allowed_caps: Box>>, + 450 | /// The Roc binary used to compile sources sent to `id world compile` + 451 | /// (default: $`ID_ROC_BIN` or `roc` from PATH). + 452 | #[arg(long, env = "ID_ROC_BIN")] + 453 ~ roc_bin: Box>, + 454 | /// The world platform directory used for on-the-fly compilation + 455 | /// (default: $`ID_ROC_PLATFORM` or ./examples/roc-world). + 456 | #[arg(long, env = "ID_ROC_PLATFORM")] + 457 ~ roc_platform: Box>, + 458 | /// Allow this node to modify the store (repeatable, comma-separated). + ... + 464 | #[arg(long = "allow-node", value_delimiter = ',')] + 465 ~ allow_node: Box>, + | + +warning: item in documentation is missing backticks + --> src/cli.rs:321:62 + | +321 | ...er does not use the mainline BitTorrent DHT + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown + = note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]` +help: try + | +321 - /// By default, the server does not use the mainline BitTorrent DHT +321 + /// By default, the server does not use the mainline `BitTorrent` DHT + | + +warning: item in documentation is missing backticks + --> src/cli.rs:1545:63 + | +1545 | ...it, the key must be in ~/.ssh/known_hosts. + | ^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1545 - /// (`SHA256:...`). Without it, the key must be in ~/.ssh/known_hosts. +1545 + /// (`SHA256:...`). Without it, the key must be in ~/.`ssh/known_hosts`. + | + +warning: item in documentation is missing backticks + --> src/cli.rs:1561:9 + | +1561 | /// ProxyCommand instead of listening. + | ^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1561 - /// ProxyCommand instead of listening. +1561 + /// `ProxyCommand` instead of listening. + | + +warning: variables can be used directly in the `format!` string + --> src/commands/find.rs:165:9 + | +165 | / ... bail!( +166 | | ... "refusing download of match with unsafe name {:?}: no final... +167 | | ... name +168 | | ... ); + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args + = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]` + +warning: variables can be used directly in the `format!` string + --> src/commands/find.rs:174:9 + | +174 | / ... bail!( +175 | | ... "refusing download of match with unsafe name {:?}: no final... +176 | | ... name +177 | | ... ); + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args + +warning: variables can be used directly in the `format!` string + --> src/commands/find.rs:180:22 + | +180 | Some(dir) => format!("{}/{}", dir, file_name), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args +help: change this to + | +180 - Some(dir) => format!("{}/{}", dir, file_name), +180 + Some(dir) => format!("{dir}/{file_name}"), + | + +warning: all if blocks contain the same code at the end + --> src/commands/find.rs:317:5 + | +317 | / let m = &all_matches[0]; +318 | | let output = if to_stdout { +319 | | "-".to_owned() +320 | | } else { +... | +329 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#branches_sharing_code + = note: `-W clippy::branches-sharing-code` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::branches_sharing_code)]` +help: consider moving these statements after the if + | +317 ~ } +318 + let m = &all_matches[0]; +319 + let output = if to_stdout { +320 + "-".to_owned() +321 + } else { +322 + download_output_path(None, &m.name)? +323 + }; +324 + if let Some(node_str) = node { +325 + let node_id: EndpointId = node_str.parse()?; +326 + cmd_get_one_remote(node_id, &m.name, &output, no_relay).await?; +327 + } else { +328 + cmd_get_one(&m.name, &output, false, false).await?; +329 + } + | + +warning: called `map().unwrap_or()` on a `Result` value + --> src/commands/group.rs:186:15 + | +186 | let now = std::time::SystemTime::now() + | _______________^ +187 | | .duration_since(std::time::UNIX_EPOCH) +188 | | .map(|d| d.as_secs()) +189 | | .unwrap_or(0); + | |_____________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or + = note: `-W clippy::map-unwrap-or` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::map_unwrap_or)]` +help: use `map_or(, )` instead + | +188 - .map(|d| d.as_secs()) +189 - .unwrap_or(0); +188 + .map_or(0, |d| d.as_secs()); + | + +warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator + --> src/commands/group.rs:192:24 + | +192 | let size_warning = warnings + | ________________________^ +193 | | .iter() +194 | | .filter(|w| matches!(w, Warning::Size { .. })) +195 | | .last(); + | |_______________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#double_ended_iterator_last + = note: `-W clippy::double-ended-iterator-last` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::double_ended_iterator_last)]` +help: try + | +195 - .last(); +195 + .next_back(); + | + +warning: these match arms have identical bodies + --> src/commands/repl.rs:1118:13 + | +1118 | / ReplContextInner::Remote { +1119 | | endpoint, +1120 | | meta_conn, +1121 | | blobs_conn, +... | +1132 | | store.shutdown().await?; +1133 | | } + | |_____________^ +1134 | / ReplContextInner::RemoteNode { +1135 | | endpoint, +1136 | | meta_conn, +1137 | | blobs_conn, +... | +1148 | | store.shutdown().await?; +1149 | | } + | |_____________^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +1118 ~ ReplContextInner::Remote { +1119 + endpoint, +1120 + meta_conn, +1121 + blobs_conn, +1122 + store, +1123 + .. +1124 ~ } | ReplContextInner::RemoteNode { + | + +warning: used underscore-prefixed binding + --> src/commands/serve.rs:1312:30 + | +1312 | if let Some(sync_task) = _event_sync_handle { + | ^^^^^^^^^^^^^^^^^^ + | +note: binding is defined here + --> src/commands/serve.rs:999:9 + | + 999 | let _event_sync_handle = event_events.clone().map(|events| { + | ^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#used_underscore_binding + = note: `-W clippy::used-underscore-binding` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::used_underscore_binding)]` + +warning: used underscore-prefixed binding + --> src/commands/serve.rs:1317:29 + | +1317 | if let Some(web_task) = _web_handle { + | ^^^^^^^^^^^ + | +note: binding is defined here + --> src/commands/serve.rs:1203:9 + | +1203 | let _web_handle = if let Some(listener) = web_listener { + | ^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#used_underscore_binding + +warning: called `map().unwrap_or()` on a `Result` value + --> src/commands/serve.rs:1456:5 + | +1456 | / std::time::SystemTime::now() +1457 | | .duration_since(std::time::UNIX_EPOCH) +1458 | | .map(|duration| duration.as_secs()) +1459 | | .unwrap_or(0) + | |_____________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or +help: use `map_or(, )` instead + | +1458 - .map(|duration| duration.as_secs()) +1459 - .unwrap_or(0) +1458 + .map_or(0, |duration| duration.as_secs()) + | + +warning: unnecessary boolean `not` operation + --> src/commands/world.rs:498:17 + | +498 | / ... if !dry_run { +499 | | ... let applied = apply_steps(&client, &admin_token, &capabilit... +500 | | ... if applied == steps.len() { +501 | | ... println!("applied {} step(s)", applied); +... | +510 | | ... println!("dry run: nothing changed"); +511 | | ... } + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#if_not_else + = note: `-W clippy::if-not-else` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::if_not_else)]` +help: try + | +498 ~ if dry_run { +499 + println!("dry run: nothing changed"); +500 + } else { +501 + let applied = apply_steps(&client, &admin_token, &capability, &steps).await?; +502 + if applied == steps.len() { +503 + println!("applied {} step(s)", applied); +504 + } else { +505 + println!( +506 + "applied {} of {} step(s); the rest were reported but not applied", +507 + applied, +508 + steps.len() +509 + ); +510 + } +511 + } + | + +warning: variables can be used directly in the `format!` string + --> src/commands/world.rs:501:25 + | +501 | println!("applied {} step(s)", applied); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args +help: change this to + | +501 - println!("applied {} step(s)", applied); +501 + println!("applied {applied} step(s)"); + | + +warning: these match arms have identical bodies + --> src/commands/world.rs:570:21 + | +570 | Err(_) => break Ok(()), + | ^^^^^^^^^^^^^^^^^^^^^^ +571 | Ok(Err(error)) => break Err(error), +572 | Ok(Ok(None)) => break Ok(()), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +570 ~ Ok(Err(error)) => break Err(error), +571 ~ Err(_) | Ok(Ok(None)) => break Ok(()), + | + +warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` + --> src/commands/world.rs:764:17 + | +764 | let check = match ssh_host_key { + | _________________^ +765 | | Some(fingerprint) => HostKeyCheck::Fingerprint(fingerprint), +766 | | None => { +767 | | let home = std::env::var_os("HOME") +... | +771 | | }; + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_match_else + = note: `-W clippy::single-match-else` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::single_match_else)]` +help: try + | +764 ~ let check = if let Some(fingerprint) = ssh_host_key { HostKeyCheck::Fingerprint(fingerprint) } else { +765 + let home = std::env::var_os("HOME") +766 + .context("no HOME for ~/.ssh/known_hosts; pass --ssh-host-key")?; +767 + HostKeyCheck::KnownHosts(PathBuf::from(home).join(".ssh").join("known_hosts")) +768 ~ }; + | + +warning: item in documentation is missing backticks + --> src/commands/world.rs:778:5 + | +778 | /// ProxyCommand) over iroh to the host's world SSH server (F13.3). The + | ^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +778 - /// ProxyCommand) over iroh to the host's world SSH server (F13.3). The +778 + /// `ProxyCommand`) over iroh to the host's world SSH server (F13.3). The + | + +warning: this could be a `const fn` + --> src/commands/world.rs:928:1 + | +928 | / fn step_is_applied(step: &crate::world_manifest::ApplyStep) -> bool { +929 | | use crate::world_manifest::ApplyStep; +930 | | matches!( +931 | | step, +... | +939 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn + = note: `-W clippy::missing-const-for-fn` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::missing_const_for_fn)]` +help: make the function `const` + | +928 | const fn step_is_applied(step: &crate::world_manifest::ApplyStep) -> bool { + | +++++ + +warning: the following explicit lifetimes could be elided: 'a + --> src/commands/world.rs:966:18 + | +966 | fn ordered_steps<'a>( + | ^^ +967 | steps: &'a [crate::world_manifest::ApplyStep], + | ^^ +968 | ) -> Vec<&'a crate::world_manifest::ApplyStep> { + | ^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_lifetimes + = note: `-W clippy::needless-lifetimes` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::needless_lifetimes)]` +help: elide the lifetimes + | +966 ~ fn ordered_steps( +967 ~ steps: &[crate::world_manifest::ApplyStep], +968 ~ ) -> Vec<&crate::world_manifest::ApplyStep> { + | + +warning: this could be a `const fn` + --> src/commands/world.rs:970:5 + | +970 | / fn rank(step: &ApplyStep) -> u8 { +971 | | match step { +972 | | ApplyStep::CancelSchedule { .. } => 0, +973 | | ApplyStep::SetProfile { .. } => 1, +... | +979 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +970 | const fn rank(step: &ApplyStep) -> u8 { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/ingest.rs:468:5 + | +468 | / fn keeps(&self) -> bool { +469 | | matches!( +470 | | self, +471 | | Self::Stored { .. } +... | +479 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +468 | const fn keeps(&self) -> bool { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/range.rs:100:5 + | +100 | / pub fn new(k: usize, t: usize) -> Result { +101 | | if k < 2 { +102 | | return Err(ParamsError::FanOut(k)); +... | +112 | | }) +113 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +100 | pub const fn new(k: usize, t: usize) -> Result { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/range.rs:136:5 + | +136 | / pub fn with_session_budget(self, bytes: usize) -> Result Result { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/range.rs:253:5 + | +253 | / pub fn len(&self) -> usize { +254 | | self.keys.len() +255 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +253 | pub const fn len(&self) -> usize { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/range.rs:258:5 + | +258 | / pub fn is_empty(&self) -> bool { +259 | | self.keys.is_empty() +260 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +258 | pub const fn is_empty(&self) -> bool { + | +++++ + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> src/event_store/range.rs:277:15 + | +277 | (out, (hi - lo) as u32) + | ^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation + = note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]` +help: ... or use `try_from` and handle the error accordingly + | +277 - (out, (hi - lo) as u32) +277 + (out, u32::try_from(hi - lo)) + | + +warning: this argument is passed by value, but not consumed in the function body + --> src/event_store/range.rs:361:16 + | +361 | upper: Option>, + | ^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value + = note: `-W clippy::needless-pass-by-value` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_pass_by_value)]` +help: consider taking a reference instead + | +361 | upper: Option<&Vec>, + | + + +warning: this `if` statement can be collapsed + --> src/event_store/range.rs:391:5 + | +391 | / if mode == Mode::Skip { +392 | | if let Some(last) = out.last_mut() { +393 | | if last.mode == Mode::Skip { +394 | | last.upper = upper; +... | +398 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if + = note: `-W clippy::collapsible-if` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::collapsible_if)]` +help: collapse nested if block + | +391 ~ if mode == Mode::Skip +392 ~ && let Some(last) = out.last_mut() { +393 | if last.mode == Mode::Skip { +... +396 | } +397 ~ } + | + +warning: this `if` statement can be collapsed + --> src/event_store/range.rs:392:9 + | +392 | / if let Some(last) = out.last_mut() { +393 | | if last.mode == Mode::Skip { +394 | | last.upper = upper; +395 | | return; +396 | | } +397 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +392 ~ if let Some(last) = out.last_mut() +393 ~ && last.mode == Mode::Skip { +394 | last.upper = upper; +395 | return; +396 ~ } + | + +warning: casting `usize` to `u8` may truncate the value + --> src/event_store/range.rs:404:19 + | +404 | out.push((x as u8 & 0x7f) | 0x80); + | ^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +404 - out.push((x as u8 & 0x7f) | 0x80); +404 + out.push((u8::try_from(x) & 0x7f) | 0x80); + | + +warning: casting `usize` to `u8` may truncate the value + --> src/event_store/range.rs:407:14 + | +407 | out.push(x as u8); + | ^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +407 - out.push(x as u8); +407 + out.push(u8::try_from(x)); + | + +warning: casting `usize` to `u8` may truncate the value + --> src/event_store/range.rs:415:22 + | +415 | out.push(b.len() as u8); + | ^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +415 - out.push(b.len() as u8); +415 + out.push(u8::try_from(b.len())); + | + +warning: first doc comment paragraph is too long + --> src/event_store/range.rs:611:1 + | +611 | / /// Runs the protocol between two in-memory sets, through the same fr... +612 | | /// each side's own parameters. `a` opens. Used to check convergence ... +613 | | /// difference without a transport. +614 | | /// +615 | | /// # Errors + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: unused import: `std::io::Write` + --> src/directory_mail.rs:257:9 + | +257 | use std::io::Write as _; + | ^^^^^^^^^^^^^^ + +warning: this could be a `const fn` + --> src/event_store/sync.rs:118:5 + | +118 | / fn add(&mut self, outcome: &Ingest) { +119 | | match outcome { +120 | | Ingest::Accepted { .. } => self.accepted += 1, +121 | | Ingest::Duplicate { .. } => self.duplicates += 1, +... | +127 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +118 | const fn add(&mut self, outcome: &Ingest) { + | +++++ + +warning: item in documentation is missing backticks + --> src/event_store/sync.rs:186:70 + | +186 | ... stream to the last event, as LogSync's does. + | ^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +186 - /// the whole session, from opening the stream to the last event, as LogSync's does. +186 + /// the whole session, from opening the stream to the last event, as `LogSync`'s does. + | + +warning: first doc comment paragraph is too long + --> src/event_store/sync.rs:184:1 + | +184 | / /// Runs one range session over an open connection. The dialer opens ... +185 | | /// `initiator = true`. `now_ms` is the clock the store's waiting rul... +186 | | /// the whole session, from opening the stream to the last event, as ... +187 | | /// +188 | | /// # Errors + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: this could be a `const fn` + --> src/event_store/sync.rs:353:5 + | +353 | / fn charge(&mut self, cost: usize) -> Result<(), BudgetExceeded> { +354 | | let total = self.read.saturating_add(cost); +355 | | if total > self.budget { +356 | | return Err(BudgetExceeded { +... | +362 | | Ok(()) +363 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +353 | const fn charge(&mut self, cost: usize) -> Result<(), BudgetExceeded> { + | +++++ + +warning: this `if` statement can be collapsed + --> src/event_store/sync.rs:520:13 + | +520 | / if let Some((records, wait)) = &cut_records { +521 | | if sent == *records { +522 | | if let Some((signal, committed)) = wait { +523 | | wait_for_commit(signal, *committed).await; +... | +528 | | } + | |_____________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +520 ~ if let Some((records, wait)) = &cut_records +521 ~ && sent == *records { +522 | if let Some((signal, committed)) = wait { +... +526 | bail!("cut before event {}", sent + 1); +527 ~ } + | + +warning: it is more idiomatic to use `Option<&T>` instead of `&Option` + --> src/event_store/sync.rs:574:1 + | +574 | / async fn receive_data( +575 | | recv: &mut RecvStream, +576 | | store: &Mutex<&mut EventStore>, +577 | | need: &mut HashSet, +... | +607 | | Ok((count, tally)) +608 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#ref_option + = note: `-W clippy::ref-option` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::ref_option)]` +help: change this to + | +579 - commits: &Option, +579 + commits: Option<&CommitSignal>, + | + +warning: it is more idiomatic to use `Option<&T>` instead of `&Option` + --> src/event_store/sync.rs:610:1 + | +610 | / fn flush( +611 | | store: &Mutex<&mut EventStore>, +612 | | pending: &mut Vec, +613 | | now_ms: u64, +... | +629 | | Ok(()) +630 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#ref_option +help: change this to + | +615 - commits: &Option, +615 + commits: Option<&CommitSignal>, + | + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/event_store/mod.rs:557:13 + | +557 | / struct StoredMeta { +558 | | author: AuthorKey, +559 | | seq: SeqNum, +560 | | parents: Vec, +... | +563 | | position: [u8; POSITION_LEN], +564 | | } + | |_____________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + = note: `-W clippy::items-after-statements` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::items_after_statements)]` + +warning: item in documentation is missing backticks + --> src/event_sync.rs:11:15 + | +11 | //! publishes ProseMirror save revisions into. `serve` opens that store ... + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +11 - //! publishes ProseMirror save revisions into. `serve` opens that store once and shares +11 + //! publishes `ProseMirror` save revisions into. `serve` opens that store once and shares + | + +warning: first doc comment paragraph is too long + --> src/event_sync.rs:72:1 + | +72 | / /// Serves range-sync sessions over the node's shared [`LocalEvents`] ... +73 | | /// Register it with `Router::builder(..).accept(ALPN, EventSyncProtoc... +74 | | /// where `events` is the same instance the web layer publishes into. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph +help: add an empty line + | +72 | /// Serves range-sync sessions over the node's shared [`LocalEvents`] store. +73 + /// + | + +warning: function `lobby_with_bo` is never used + --> src/web/explore.rs:673:14 + | +673 | async fn lobby_with_bo() -> (Router, String) { + | ^^^^^^^^^^^^^ + +warning: function `test_footnote_roundtrip_fixpoint` is never used + --> src/web/markdown.rs:3440:8 + | +3440 | fn test_footnote_roundtrip_fixpoint() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: first doc comment paragraph is too long + --> src/groups/worlds.rs:1:1 + | +1 | / //! Cross-world authority (P2.7, task 03 item 7): each world judges its... +2 | | //! membership and delegations, and a grant that names another world is... +3 | | //! authority reaches into another. +4 | | //! +5 | | //! The design (§7.5 and the two cross-world docs) says the rules "over... + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: this could be rewritten as `let...else` + --> src/groups/delegation.rs:97:9 + | + 97 | / let (author, author_role) = match self.effective_author(by_id... + 98 | | Some(res) => res, + 99 | | None => return Ok(Err(Refusal::NotActive)), +100 | | }; + | |__________^ help: consider writing: `let Some((author, author_role)) = self.effective_author(by_id, group, event) else { return Ok(Err(Refusal::NotActive)) };` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_let_else + = note: `-W clippy::manual-let-else` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_let_else)]` + +warning: this could be rewritten as `let...else` + --> src/groups/delegation.rs:141:9 + | +141 | / let (author, author_role) = match self.effective_author(by_id... +142 | | Some(res) => res, +143 | | None => return Ok(Err(Refusal::NotActive)), +144 | | }; + | |__________^ help: consider writing: `let Some((author, author_role)) = self.effective_author(by_id, group, event) else { return Ok(Err(Refusal::NotActive)) };` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_let_else + +warning: this `if` statement can be collapsed + --> src/local_events.rs:311:17 + | +311 | / if seen.insert(claim.author) { +312 | | if let Some(head) = heads.get(&claim.author) { +313 | | required.push(*head); +314 | | } +315 | | } + | |_________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +311 ~ if seen.insert(claim.author) +312 ~ && let Some(head) = heads.get(&claim.author) { +313 | required.push(*head); +314 ~ } + | + +warning: wildcard matches only a single variant and will also match any future added variants + --> src/meta_client.rs:59:9 + | +59 | other => other.into(), + | ^^^^^ help: try: `other @ ReadToEndError::Read(_)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_wildcard_for_single_variants + = note: `-W clippy::match-wildcard-for-single-variants` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::match_wildcard_for_single_variants)]` + +warning: these match arms have identical bodies + --> src/repl/runner.rs:389:9 + | +389 | / (None, ["tags" | "labels" | "links"]) => { +390 | | ctx.get_tags(None).await?; +391 | | Ok(ReplAction::Continue) +392 | | } + | |_________^ +... +406 | / (None, ["tag" | "label" | "link", "list" | "ls"]) => { +407 | | ctx.get_tags(None).await?; +408 | | Ok(ReplAction::Continue) +409 | | } + | |_________^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +389 ~ (None, ["tags" | "labels" | "links"]) | (None, ["tag" | "label" | "link", "list" | "ls"]) => { +390 | ctx.get_tags(None).await?; +... +405 | } +406 ~ (None, ["tag" | "label" | "link", "list" | "ls", subject]) => { + | + +warning: these match arms have identical bodies + --> src/repl/runner.rs:393:9 + | +393 | / (None, ["tags" | "labels" | "links", subject]) => { +394 | | ctx.get_tags(Some(subject)).await?; +395 | | Ok(ReplAction::Continue) +396 | | } + | |_________^ +... +410 | / (None, ["tag" | "label" | "link", "list" | "ls", subject]) => { +411 | | ctx.get_tags(Some(subject)).await?; +412 | | Ok(ReplAction::Continue) +413 | | } + | |_________^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +393 ~ (None, ["tags" | "labels" | "links", subject]) | (None, ["tag" | "label" | "link", "list" | "ls", subject]) => { +394 | ctx.get_tags(Some(subject)).await?; +... +409 | } +410 ~ (None, ["migrate-tags" | "migrate"]) => { + | + +warning: very complex type used. Consider factoring parts into `type` definitions + --> src/search.rs:106:22 + | +106 | ...d: Vec<(BTreeSet<[u8; 32]>, BTreeMap<[u8; 32], BTreeSet<[u8; 32]>>)> = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#type_complexity + = note: `-W clippy::type-complexity` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::type_complexity)]` + +warning: first doc comment paragraph is too long + --> src/search.rs:192:1 + | +192 | / /// The multi-term search over the store's live claims, read by [`Eve... +193 | | /// [`Term::SubjectKind`] resolves through the store: the subject's e... +194 | | /// [`EventStore::event_by_id`], and the kind in its header extension. +195 | | /// +196 | | /// # Errors + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph +help: add an empty line + | +192 | /// The multi-term search over the store's live claims, read by [`EventStore::tag_claims`]. +193 + /// + | + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/seitan/accept.rs:119:61 + | +119 | let wire: Wire = rmp_serde::from_slice(message).map_err(|_| ProofEr... + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + = note: requested on the command line with `-W clippy::map-err-ignore` + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/seitan/accept.rs:140:60 + | +140 | let key = VerifyingKey::from_bytes(public_key).map_err(|_| ProofErr... + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/seitan/accept.rs:143:18 + | +143 | .map_err(|_| ProofError::BadSignature) + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: first doc comment paragraph is too long + --> src/server_config/mod.rs:93:1 + | +93 | / /// The server's serving policy: the operator-set knobs of the freshne... +94 | | /// pull policy (P6.5). Both have code defaults, so a config that sets... +95 | | /// as before: a five-minute window and open pull. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: this could be a `const fn` + --> src/server_config/mod.rs:196:5 + | +196 | / pub fn freshness(&self) -> Freshness { +197 | | Freshness { +198 | | server: self.policy.freshness_window, +199 | | world: None, +... | +202 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +196 | pub const fn freshness(&self) -> Freshness { + | +++++ + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/shell_contract.rs:174:30 + | +174 | .map_err(|_| format!("unknown field type `{name}`"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: consider adding a `;` to the last statement for consistent formatting + --> src/shell_contract.rs:434:17 + | +434 | ... check_value(field, value).map_err(|error| format!("`{kind}.{name}` {error}"))? + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `check_value(field, value).map_err(|error| format!("`{kind}.{name}` {error}"))?;` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#semicolon_if_nothing_returned + = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::semicolon_if_nothing_returned)]` + +warning: first doc comment paragraph is too long + --> src/tag_claims.rs:158:1 + | +158 | / /// The events that `start` reaches by following parent links: its ow... +159 | | /// `parents` maps each event to the events it names, its `after` has... +160 | | /// starting events are included. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph +help: add an empty line + | +158 | /// The events that `start` reaches by following parent links: its own causal past, transitively. +159 + /// + | + +warning: parameter of type `HashMap` should be generalized over different hashers + --> src/tag_claims.rs:162:46 + | +162 | ...t: &[Hash], parents: &HashMap>) -> HashSet { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#implicit_hasher + = note: `-W clippy::implicit-hasher` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::implicit_hasher)]` +help: add a type parameter for `BuildHasher` + | +162 | pub fn causal_past(start: &[Hash], parents: &HashMap, S>) -> HashSet { + | +++++++++++++++++++++++++++++ +++ + +warning: parameter of type `HashMap` should be generalized over different hashers + --> src/tag_claims.rs:182:51 + | +182 | ...&[Applied], parents: &HashMap>) -> Vec { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#implicit_hasher +help: add a type parameter for `BuildHasher` + | +182 | pub fn live_claims(applied: &[Applied], parents: &HashMap, S>) -> Vec { + | +++++++++++++++++++++++++++++ +++ + +warning: parameter of type `HashMap` should be generalized over different hashers + --> src/tag_claims.rs:232:56 + | +232 | ...&[Applied], parents: &HashMap>) -> Vec { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#implicit_hasher +help: add a type parameter for `BuildHasher` + | +232 | pub fn compacted_claims(applied: &[Applied], parents: &HashMap, S>) -> Vec { + | +++++++++++++++++++++++++++++ +++ + +warning: casting `u128` to `u64` may truncate the value + --> src/time.rs:10:30 + | +10 | .map_or(0, |elapsed| elapsed.as_millis() as u64) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +10 - .map_or(0, |elapsed| elapsed.as_millis() as u64) +10 + .map_or(0, |elapsed| u64::try_from(elapsed.as_millis())) + | + +warning: statement has unnecessary safety comment + --> src/tuple.rs:332:13 + | +332 | let u = v as u64; + | ^^^^^^^^^^^^^^^^^ + | +help: consider removing the safety comment + --> src/tuple.rs:330:16 + | +330 | // Safety: v > 0 so cast to u64 is lossless + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unnecessary_safety_comment + = note: requested on the command line with `-W clippy::unnecessary-safety-comment` + +warning: this argument is passed by value, but not consumed in the function body + --> src/world/actor.rs:331:34 + | +331 | fn persist(&mut self, entry: JournalEntry) -> Result<()> { + | ^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +331 | fn persist(&mut self, entry: &JournalEntry) -> Result<()> { + | + + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world/actor.rs:360:5 + | +360 | / async fn deliver(&mut self, text: String) -> bool { +361 | | if !self.program_healthy || self.storage_failed { +362 | | return false; +... | +394 | | journaled +395 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl + = note: `-W clippy::unused-async-trait-impl` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_async_trait_impl)]` +help: consider removing the `async` from this function and returning `impl Future` instead + | +360 ~ fn deliver(&mut self, text: String) -> impl Future { +361 | if !self.program_healthy || self.storage_failed { +362 ~ return std::future::ready(false); +363 | } +364 | if text.len() > crate::world_caps::MAX_EVENT_BYTES { +365 | tracing::error!("world event exceeds the delivery bound; dropped"); +366 ~ return std::future::ready(false); +367 | } +... +375 | tracing::error!("world program rejected a host event: {error:#}"); +376 ~ return std::future::ready(false); +377 | } +... +385 | tracing::error!("world program records failed: {error:#}"); +386 ~ return std::future::ready(false); +387 | } +... +393 | let _ = self.view_changed.send(self.core.sequence); +394 ~ std::future::ready(journaled) + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/world/actor.rs:584:21 + | +584 | / request +585 | | .args +586 | | .get("count") +587 | | .and_then(serde_json::Value::as_u64) +588 | | .unwrap_or(16) +589 | | .min(crate::world_caps::MAX_CHAT_HISTORY_LINES as u64) as usize, + | |_______________________________________________________________________________________^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +584 ~ usize::try_from(request +585 + .args +586 + .get("count") +587 + .and_then(serde_json::Value::as_u64) +588 + .unwrap_or(16) +589 ~ .min(crate::world_caps::MAX_CHAT_HISTORY_LINES as u64)), + | + +warning: using `.clone()` on a ref-counted pointer + --> src/world/actor.rs:620:23 + | +620 | let records = self.records_sender.borrow().1.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&self.records_sender.borrow().1)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + = note: requested on the command line with `-W clippy::clone-on-ref-ptr` + +warning: this function's return value is unnecessarily wrapped by `Result` + --> src/world/actor.rs:907:5 + | +907 | fn caps_report(&mut self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unnecessary_wraps + = note: `-W clippy::unnecessary-wraps` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::unnecessary_wraps)]` +help: remove `Result` from the return type... + | +907 - fn caps_report(&mut self) -> Result { +907 + fn caps_report(&mut self) -> world_caps::CapsReport { + | +help: ...and then remove the surrounding `Ok()` from returning expressions + | +922 ~ CapsReport { +923 + granted, +924 + requested, +925 + missing, +926 + usage: self.core.ledger.usage().clone(), +927 + policy: if self.core.ledger.grant_on_use() { +928 + "grant-on-use" +929 + } else { +930 + "deny" +931 + } +932 + .to_owned(), +933 + catalog: crate::world_caps::CATALOG +934 + .iter() +935 + .map(|name| (*name).to_owned()) +936 + .collect(), +937 + ceiling: self.core.caps_ceiling.iter().cloned().collect(), +938 + effective, +939 + view_failures: self.view_failures, +940 + } + | + +warning: these match arms have identical bodies + --> src/world/actor.rs:912:13 + | +912 | Ok(None) => Vec::new(), + | ^^^^^^^^^^^^^^^^^^^^^^ +913 | Err(_) => Vec::new(), + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +912 ~ Ok(None) | Err(_) => Vec::new(), +913 ~ }; + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world/actor.rs:1398:5 + | +1398 | / async fn compact_if_due(&mut self) { +1399 | | if self.compaction_off +1400 | | || self.storage_failed +1401 | | || !self.program_healthy +... | +1420 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future` instead + | +1398 ~ fn compact_if_due(&mut self)impl Future { +1399 | if self.compaction_off + ... +1409 | let started = std::time::Instant::now(); +1410 ~ std::future::ready(match compact_journal(&mut self.core, self.program.as_mut(), journal.as_mut()) { +1411 + Ok(true) => self.metrics.record_checkpoint(started.elapsed()), +1412 + Ok(false) => self.compaction_off = true, +1413 + Err(error) => { +1414 + // The journal is still complete; just do not retry until +1415 + // something changes. +1416 + tracing::warn!("world checkpoint skipped: {error:#}"); +1417 + self.compaction_off = true; +1418 + } +1419 + }) + | + +warning: these match arms have identical bodies + --> src/world/core.rs:294:17 + | +294 | JournalEntry::BuilderInstalled { .. } => {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +295 | // Audit-only: the copied entries alread... +296 | JournalEntry::Forked { .. } => {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +294 ~ JournalEntry::BuilderInstalled { .. } | JournalEntry::Forked { .. } => {} +295 | // Audit-only: the copied entries already reproduce the parent. +296 ~ JournalEntry::System { event } => { + | + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/world/core.rs:334:29 + | +334 | ... core.active_module_provenance = provenance.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `core.active_module_provenance.clone_from(provenance)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + = note: `-W clippy::assigning-clones` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::assigning_clones)]` + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/world/core.rs:379:21 + | +379 | core.active_module_provenance = provenance.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `core.active_module_provenance.clone_from(&provenance)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:121:22 + | +121 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:189:22 + | +189 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:223:22 + | +223 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:235:22 + | +235 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:253:22 + | +253 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:271:22 + | +271 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:288:22 + | +288 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:313:22 + | +313 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:329:22 + | +329 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:354:22 + | +354 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:371:22 + | +371 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:398:22 + | +398 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:414:22 + | +414 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:430:22 + | +430 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:442:22 + | +442 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:474:22 + | +474 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:498:22 + | +498 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:525:22 + | +525 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:549:22 + | +549 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:564:22 + | +564 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:586:22 + | +586 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:602:22 + | +602 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:618:22 + | +618 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:630:22 + | +630 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:653:22 + | +653 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:669:22 + | +669 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:682:22 + | +682 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:705:22 + | +705 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:756:22 + | +756 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:768:22 + | +768 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: item in documentation is missing backticks + --> src/world_caps.rs:30:61 + | +30 | //! part of the wire contract and never change meaning; the DoS suite as... + | ^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +30 - //! part of the wire contract and never change meaning; the DoS suite asserts +30 + //! part of the wire contract and never change meaning; the `DoS` suite asserts + | + +warning: this argument is passed by value, but not consumed in the function body + --> src/world_caps.rs:333:54 + | +333 | pub fn subscription_refused_event(spec: &str, error: CapError) -> String { + | ^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +333 | pub fn subscription_refused_event(spec: &str, error: &CapError) -> String { + | + + +warning: item in documentation is missing backticks + --> src/world_caps.rs:355:70 + | +355 | /// These are documented in the capability guide and asserted by the DoS + | ^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +355 - /// These are documented in the capability guide and asserted by the DoS +355 + /// These are documented in the capability guide and asserted by the `DoS` + | + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/world_compile.rs:285:17 + | +285 | use std::io::Read; + | ^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/world_compile.rs:291:17 + | +291 | use std::io::Read; + | ^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: allocating a local array larger than 16384 bytes + --> src/world_compile.rs:365:22 + | +365 | let mut buffer = [0_u8; 64 * 1024]; + | ^^^^^^^^^^^^^^^^^ + | + = help: consider allocating on the heap with `vec![0_u8; 64 * 1024].into_boxed_slice()` + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#large_stack_arrays + = note: `-W clippy::large-stack-arrays` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::large_stack_arrays)]` + +warning: allocating a local array larger than 16384 bytes + --> src/world_compile.rs:410:30 + | +410 | let mut buffer = [0_u8; 64 * 1024]; + | ^^^^^^^^^^^^^^^^^ + | + = help: consider allocating on the heap with `vec![0_u8; 64 * 1024].into_boxed_slice()` + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#large_stack_arrays + +warning: function has unnecessary safety comment + --> src/world_compile.rs:531:1 + | +531 | fn apply_rlimits() -> std::io::Result<()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: consider removing the safety comment + --> src/world_compile.rs:529:5 + | +529 | /// Safety: runs between fork and exec; only async-signal-safe calls + | ^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unnecessary_safety_comment + +warning: `format!(..)` appended to existing `String` + --> src/world_doctor.rs:104:13 + | +104 | / out.push_str(&format!( +105 | | "{tag:4} {:<9} {}\n", +106 | | finding.check, finding.detail +107 | | )); + | |______________^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string + = note: requested on the command line with `-W clippy::format-push-string` +help: consider using `write!` to avoid the extra allocation + | +104 ~ let _ = write!(out, "{tag:4} {:<9} {}\n", +105 ~ finding.check, finding.detail); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_doctor.rs:109:17 + | +109 | out.push_str(&format!(" fix: {}\n", finding.fix)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +109 - out.push_str(&format!(" fix: {}\n", finding.fix)); +109 + let _ = write!(out, " fix: {}\n", finding.fix); + | + +warning: function call inside of `or` + --> src/world_fixture.rs:236:42 + | +236 | let extra = first.get(index).or(second.get(index))?; + | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_else(|| second.get(index))` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#or_fun_call + = note: `-W clippy::or-fun-call` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::or_fun_call)]` + +warning: first doc comment paragraph is too long + --> src/world_hub.rs:145:1 + | +145 | / /// The JSON shape of a world directory listing: the shared serialize... +146 | | /// directory feed (#812). The CLI's `id world list --json` prints ex... +147 | | /// and the web UI's directory surface is expected to consume the sam... +148 | | /// +149 | | /// The shape is `{ "default": , "worlds": [{ "name": ..., "loa... + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:298:22 + | +298 | .map_err(|_| ResolveError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:304:22 + | +304 | .map_err(|_| ResolveError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:478:43 + | +478 | validate_world_name(name).map_err(|_| ResolveError::InvalidName)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:481:22 + | +481 | .map_err(|_| ResolveError::Busy)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:544:22 + | +544 | .map_err(|_| ResolveError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:617:43 + | +617 | validate_world_name(name).map_err(|_| ResolveError::InvalidName)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:631:22 + | +631 | .map_err(|_| ResolveError::Busy)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: avoid using `collect()` when not needed + --> src/world_hub.rs:679:18 + | +679 | .collect(); + | ^^^^^^^ +680 | / names +681 | | .into_iter() + | |____________________________- the iterator could be used here instead + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_collect + = note: `-W clippy::needless-collect` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::needless_collect)]` +help: use the original Iterator instead of collecting it and then producing a new one + | +671 ~ +672 ~ slots +673 + .iter() +674 + .filter(|(_, slot)| { +675 + slot.service.get().is_some() +676 + && slot.leases.load(Ordering::Acquire) == 0 +677 + && slot.idle_for() >= idle +678 + }) +679 + .map(|(name, _)| name.clone()) + | + +warning: this `impl` can be derived + --> src/world_manifest.rs:75:1 + | +75 | / impl Default for WorldState { +76 | | fn default() -> Self { +77 | | Self { +78 | | module_hash: None, +... | +86 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#derivable_impls + = note: `-W clippy::derivable-impls` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::derivable_impls)]` +help: replace the manual implementation with a derive attribute + | +60 + #[derive(Default)] +61 | pub struct WorldState { + | + +warning: this could be a `const fn` + --> src/world_manifest.rs:134:5 + | +134 | / pub fn kind(&self) -> &'static str { +135 | | match self { +136 | | Self::InstallModule { .. } => "install_module", +137 | | Self::SetGrants { .. } => "set_grants", +... | +143 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +134 | pub const fn kind(&self) -> &'static str { + | +++++ + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/world_manifest.rs:326:21 + | +326 | state.grants = grants.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `state.grants.clone_from(grants)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/world_manifest.rs:335:21 + | +335 | state.ceiling = ceiling.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `state.ceiling.clone_from(ceiling)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:381:21 + | +381 | ... out.push_str(&format!("- module {hash} (seed {seed})\n")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +381 - out.push_str(&format!("- module {hash} (seed {seed})\n")); +381 + let _ = write!(out, "- module {hash} (seed {seed})\n"); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:384:21 + | +384 | / out.push_str(&format!( +385 | | "+ module source {} (seed {seed})\n", +386 | | source.display() +387 | | )); + | |______________________^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +384 ~ let _ = write!(out, "+ module source {} (seed {seed})\n", +385 ~ source.display()); + | + +warning: consider adding a `;` to the last statement for consistent formatting + --> src/world_manifest.rs:391:17 + | +391 | ... out.push_str(&format!("~ grants [{}]\n", grants.join(", "))) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `out.push_str(&format!("~ grants [{}]\n", grants.join(", ")));` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#semicolon_if_nothing_returned + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:391:17 + | +391 | ... out.push_str(&format!("~ grants [{}]\n", grants.join(", "))) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +391 - out.push_str(&format!("~ grants [{}]\n", grants.join(", "))) +391 + let _ = write!(out, "~ grants [{}]\n", grants.join(", ")) + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:395:21 + | +395 | ... out.push_str(&format!("~ ceiling [{}]\n", names.join(", "))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +395 - out.push_str(&format!("~ ceiling [{}]\n", names.join(", "))); +395 + let _ = write!(out, "~ ceiling [{}]\n", names.join(", ")); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:400:17 + | +400 | out.push_str(&format!("~ profile {profile:?}\n")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +400 - out.push_str(&format!("~ profile {profile:?}\n")); +400 + let _ = write!(out, "~ profile {profile:?}\n"); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:403:17 + | +403 | out.push_str(&format!("+ schedule {id} at {at_ms}\n")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +403 - out.push_str(&format!("+ schedule {id} at {at_ms}\n")); +403 + let _ = write!(out, "+ schedule {id} at {at_ms}\n"); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:406:17 + | +406 | out.push_str(&format!("- schedule {id}\n")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +406 - out.push_str(&format!("- schedule {id}\n")); +406 + let _ = write!(out, "- schedule {id}\n"); + | + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_native.rs:116:22 + | +116 | .map_err(|_| anyhow::anyhow!("native worker is gone"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: casting `u64` to `u32` may truncate the value + --> src/world_native.rs:243:27 + | +243 | let participant = participant.min(u64::from(u32::MAX)) as u32; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +243 - let participant = participant.min(u64::from(u32::MAX)) as u32; +243 + let participant = u32::try_from(participant.min(u64::from(u32::MAX))); + | + +warning: casting `i64` to `i32` may truncate the value + --> src/world_native.rs:340:46 + | +340 | let root = unsafe { OwnedFd::from_raw_fd(fd as i32) }; + | ^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +340 - let root = unsafe { OwnedFd::from_raw_fd(fd as i32) }; +340 + let root = unsafe { OwnedFd::from_raw_fd(i32::try_from(fd)) }; + | + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/world_native.rs:409:9 + | +409 | / struct LandlockRulesetAttr { +410 | | handled_access_fs: u64, +411 | | handled_access_net: u64, +412 | | scoped: u64, +413 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/world_native.rs:430:9 + | +430 | / struct LandlockPathBeneathAttr { +431 | | allowed_access: u64, +432 | | parent_fd: i32, +433 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: casting `i64` to `u64` may lose the sign of the value + --> src/world_native.rs:442:13 + | +442 | ruleset as libc::c_ulong, + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, use `cast_unsigned()` instead: `ruleset.cast_unsigned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_sign_loss + = note: `-W clippy::cast-sign-loss` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_sign_loss)]` + +warning: casting `i64` to `u64` may lose the sign of the value + --> src/world_native.rs:453:13 + | +453 | ruleset as libc::c_ulong, + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, use `cast_unsigned()` instead: `ruleset.cast_unsigned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_sign_loss + +warning: casting `u32` to `i32` may wrap around the value + --> src/world_native.rs:469:69 + | +469 | ..._raw_os_error(1003 + resource as i32)); + | ^^^^^^^^^^^^^^^ help: if this is intentional, use `cast_signed()` instead: `resource.cast_signed()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_wrap + = note: `-W clippy::cast-possible-wrap` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_wrap)]` + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_native.rs:487:49 + | +487 | len: u16::try_from(program_len).map_err(|_| { + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: casting `usize` to `u8` may truncate the value + --> src/world_native.rs:687:13 + | +687 | jf: (ret_kill_index - 2) as u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +687 - jf: (ret_kill_index - 2) as u8, +687 + jf: u8::try_from(ret_kill_index - 2), + | + +warning: casting `usize` to `u8` may truncate the value + --> src/world_native.rs:698:17 + | +698 | jt: ((ret_allow_index - (3 + index)) - 1) as u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +698 - jt: ((ret_allow_index - (3 + index)) - 1) as u8, +698 + jt: u8::try_from((ret_allow_index - (3 + index)) - 1), + | + +warning: casting `usize` to `u8` may truncate the value + --> src/world_native.rs:707:17 + | +707 | ...t: ((ret_kill_index + 1 + index * 4) - (3 + plain + index) - 1) as u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +707 - jt: ((ret_kill_index + 1 + index * 4) - (3 + plain + index) - 1) as u8, +707 + jt: u8::try_from((ret_kill_index + 1 + index * 4) - (3 + plain + index) - 1), + | + +warning: casting `usize` to `u8` may truncate the value + --> src/world_native.rs:737:17 + | +737 | jt: (ret_allow_index - jeq_index - 1) as u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +737 - jt: (ret_allow_index - jeq_index - 1) as u8, +737 + jt: u8::try_from(ret_allow_index - jeq_index - 1), + | + +warning: missing `#[must_use]` attribute on a method returning `Self` + --> src/world_presentation.rs:83:5 + | + 83 | / pub fn fit(&self, width: usize, height: usize) -> Self { + 84 | | let width = width.min(usize::from(self.width)); + 85 | | let height = height.min(usize::from(self.height)); + 86 | | let mut cells = Vec::with_capacity(width * height); +... | +109 | | } + | |_____^ + | + = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#return_self_not_must_use + = note: `-W clippy::return-self-not-must-use` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::return_self_not_must_use)]` + +warning: this `if` statement can be collapsed + --> src/world_presentation.rs:90:13 + | + 90 | / if row.last().is_some_and(|cell| cell.columns == 2) { + 91 | | if let Some(last) = row.last_mut() { + 92 | | *last = ScreenCell { + 93 | | symbol: " ".to_owned(), +... | +100 | | } + | |_____________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | + 90 ~ if row.last().is_some_and(|cell| cell.columns == 2) + 91 ~ && let Some(last) = row.last_mut() { + 92 | *last = ScreenCell { +... + 98 | }; + 99 ~ } + | + +warning: this could be a `const fn` + --> src/world_session/mod.rs:189:5 + | +189 | / pub(crate) fn frame_meter(&self) -> &WorldMetrics { +190 | | &self.metrics +191 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +189 | pub(crate) const fn frame_meter(&self) -> &WorldMetrics { + | +++++ + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:262:22 + | +262 | .map_err(|_| anyhow::anyhow!("admin denied"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:409:22 + | +409 | .map_err(|_| InstallError::Unavailable) + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:550:26 + | +550 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:549:26 + | +549 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:559:26 + | +559 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:565:30 + | +565 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:573:26 + | +573 | .map_err(|_| InstallError::InvalidModule)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:571:26 + | +571 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:595:26 + | +595 | .map_err(|_| InstallError::InvalidModule)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:593:26 + | +593 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:603:22 + | +603 | .map_err(|_| InstallError::InvalidModule)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:602:22 + | +602 | .map_err(|_| InstallError::InvalidModule)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:614:26 + | +614 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:613:26 + | +613 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:633:45 + | +633 | ... let pin = pin.await.map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:650:22 + | +650 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:677:22 + | +677 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:693:22 + | +693 | .map_err(|_| InstallError::InvalidUpload)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:709:26 + | +709 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:708:26 + | +708 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: these match arms have identical bodies + --> src/world_session/mod.rs:747:9 + | +747 | / ClientFrame::Invite { admin_token, .. } +748 | | | ClientFrame::InstallBegin { admin_token, .. } +749 | | | ClientFrame::Compile { admin_token, .. } +750 | | | ClientFrame::CreateWorld { admin_token } +751 | | | ClientFrame::ListWorlds { admin_token } => Some(admin_token), + | |______________________________________________________________________^ +752 | ClientFrame::SetExecutionProfile { admin_token, .. } => Some(admin_token), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +747 ~ ClientFrame::Invite { admin_token, .. } +748 + | ClientFrame::InstallBegin { admin_token, .. } +749 + | ClientFrame::Compile { admin_token, .. } +750 + | ClientFrame::CreateWorld { admin_token } +751 ~ | ClientFrame::ListWorlds { admin_token } | ClientFrame::SetExecutionProfile { admin_token, .. } => Some(admin_token), + | + +warning: large future with a size of 22248 bytes + --> src/connectivity.rs:389:9 + | +389 | / within( +390 | | Duration::from_secs(240), +391 | | "running the N0 dial test", +392 | | async { +... | +434 | | }, +435 | | ) + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#large_futures + = note: `-W clippy::large-futures` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::large_futures)]` +help: consider `Box::pin` on it + | +389 ~ Box::pin(within( +390 + Duration::from_secs(240), +391 + "running the N0 dial test", +392 + async { +393 + let server = public_builder(RelayPolicy::N0) +394 + .alpns(vec![TEST_ALPN.to_vec()]) +395 + .bind() +396 + .await?; +397 + let client = public_builder(RelayPolicy::N0).bind().await?; +398 + // Wait for a home relay on both sides. The server publishes its +399 + // address once the relay is known, so an early lookup can miss it. +400 + server.online().await; +401 + client.online().await; +402 + let server_id = server.id(); +403 + +404 + let accepting = tokio::spawn({ +405 + let server = server.clone(); +406 + async move { +407 + let incoming = server.accept().await.context("server closed")?; +408 + anyhow::Ok(incoming.await?) +409 + } +410 + }); +411 + let mut attempt = 1; +412 + let conn = loop { +413 + match connect(&client, server_id, TEST_ALPN).await { +414 + Ok(conn) => break conn, +415 + Err(err) if attempt < 3 => { +416 + eprintln!("dial attempt {attempt} failed, retrying: {err:#}"); +417 + attempt += 1; +418 + tokio::time::sleep(Duration::from_secs(2)).await; +419 + } +420 + Err(err) => return Err(err), +421 + } +422 + }; +423 + anyhow::ensure!(conn.remote_id() == server_id, "dialed a different endpoint"); +424 + let accepted = accepting.await??; +425 + anyhow::ensure!( +426 + accepted.remote_id() == client.id(), +427 + "accepted from a different endpoint" +428 + ); +429 + +430 + conn.close(0u32.into(), b"done"); +431 + client.close().await; +432 + server.close().await; +433 + anyhow::Ok(()) +434 + }, +435 + )) + | + +warning: `to_string()` called on a `&str` + --> src/world_session/mod.rs:1284:55 + | +1284 | let token = JoinCapability::from_wire(cap.to_string()); + | ^^^^^^^^^^^^^^^ help: try: `cap.to_owned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#str_to_string + = note: requested on the command line with `-W clippy::str-to-string` + +warning: `to_string()` called on a `&str` + --> src/world_session/mod.rs:1317:55 + | +1317 | let token = JoinCapability::from_wire(cap.to_string()); + | ^^^^^^^^^^^^^^^ help: try: `cap.to_owned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#str_to_string + +warning: unnecessary boolean `not` operation + --> src/world_session/mod.rs:1322:13 + | +1322 | / ... if !auth_ok { +1323 | | ... let _ = send_error(service.frame_meter(), io, "access deni... +1324 | | ... } else { +1325 | | ... match service.world().execution_profile().await { +... | +1344 | | ... } + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#if_not_else +help: try + | +1322 ~ if auth_ok { +1323 + match service.world().execution_profile().await { +1324 + Ok(profile) => { +1325 + let _ = send_json( +1326 + service.frame_meter(), +1327 + io, +1328 + &ServerFrame::ExecutionProfile { +1329 + update: crate::world::ExecutionProfileUpdate { +1330 + requested: profile, +1331 + applies_on_next_program_install_or_process_restart: false, +1332 + }, +1333 + message: "current persisted execution profile", +1334 + }, +1335 + ) +1336 + .await; +1337 + } +1338 + Err(error) => { +1339 + let _ = send_error(service.frame_meter(), io, &format!("{error:#}")).await; +1340 + } +1341 + } +1342 + } else { +1343 + let _ = send_error(service.frame_meter(), io, "access denied").await; +1344 + } + | + +warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` + --> src/world_session/mod.rs:1477:17 + | +1477 | / match service.world().snapshot(token).await { +1478 | | Ok(_) => match service.world().metrics().await { +1479 | | Ok(metrics) => { +1480 | | if !send_json( +... | +1500 | | } + | |_________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_match_else +help: try + | +1477 ~ if let Ok(_) = service.world().snapshot(token).await { match service.world().metrics().await { +1478 + Ok(metrics) => { +1479 + if !send_json( +1480 + service.frame_meter(), +1481 + io, +1482 + &ServerFrame::Metrics { metrics }, +1483 + ) +1484 + .await +1485 + { +1486 + return; +1487 + } +1488 + } +1489 + Err(error) => { +1490 + let _ = +1491 + send_error(service.frame_meter(), io, &format!("{error:#}")).await; +1492 + return; +1493 + } +1494 + } } else { +1495 + let _ = send_error(service.frame_meter(), io, "join denied").await; +1496 + return; +1497 + } + | + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1660:18 + | +1660 | .map_err(|_| "module bytes are unavailable")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1681:18 + | +1681 | .map_err(|_| "the host does not hold a module with that hash")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1753:18 + | +1753 | .map_err(|_| "world is busy installing another module")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1777:26 + | +1777 | .map_err(|_| "timed out receiving module")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1800:22 + | +1800 | .map_err(|_| "timed out waiting for install completion")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: function call inside of `map_or` + --> src/world_session/mod.rs:2061:43 + | +2061 | ... let screen = viewport.map_or(screen.clone(), |viewport| { + | _____________________________^ +2062 | | ... screen.fit(viewport.width, viewport.height) +2063 | | ... }); + | |________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#or_fun_call +help: try + | +2061 ~ let screen = viewport.map_or_else(|| screen.clone(), |viewport| { +2062 + screen.fit(viewport.width, viewport.height) +2063 ~ }); + | + +warning: first doc comment paragraph is too long + --> src/world_ssh.rs:83:1 + | +83 | / /// ALPN for SSH-over-iroh tunnels (F13.3): each bidirectional stream ... +84 | | /// raw SSH connection forwarded to the host's own SSH server. The tunnel +85 | | /// carries bytes only; SSH authentication happens inside it, unchanged. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:283:5 + | +283 | / async fn auth_password(&mut self, user: &str, password: &str) -> ... +284 | | if self.permit.is_none() { +285 | | return Ok(Auth::reject()); +... | +302 | | Ok(Auth::Accept) +303 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +283 ~ fn auth_password(&mut self, user: &str, password: &str) -> impl Future> { +284 | if self.permit.is_none() { +285 ~ return std::future::ready(Ok(Auth::reject())); +286 | } +... +301 | }); +302 ~ std::future::ready(Ok(Auth::Accept)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:305:5 + | +305 | / async fn auth_publickey( +306 | | &mut self, +307 | | user: &str, +308 | | public_key: &PublicKey, +... | +326 | | Ok(Auth::Accept) +327 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +305 ~ fn auth_publickey( +306 | &mut self, +307 | user: &str, +308 | public_key: &PublicKey, +309 ~ ) -> impl Future> { +310 | let Some(world) = user.strip_prefix(EXPLORE_PREFIX) else { +311 ~ return std::future::ready(Ok(Auth::reject())); +312 | }; +313 | let Some(ed25519) = public_key.key_data().ed25519() else { +314 ~ return std::future::ready(Ok(Auth::reject())); +315 | }; +316 | if self.permit.is_none() { +317 ~ return std::future::ready(Ok(Auth::reject())); +318 | } +... +325 | }); +326 ~ std::future::ready(Ok(Auth::Accept)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:359:5 + | +359 | / async fn exec_request( +360 | | &mut self, +361 | | channel: ChannelId, +362 | | data: &[u8], +... | +390 | | Ok(()) +391 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +359 ~ fn exec_request( +360 | &mut self, +... +363 | session: &mut Session, +364 ~ ) -> impl Future> { +365 | // The frame protocol is the only command, and one session (shell or +... +371 | { +372 ~ return std::future::ready(session.channel_failure(channel)); +373 | } +374 | let (exec, bytes) = mpsc::unbounded_channel(); +375 | self.exec = Some(exec); +376 ~ std::future::ready(session.channel_success(channel)?); +377 | let mut io = SshFrameIo { +... +389 | }); +390 ~ std::future::ready(Ok(())) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:393:5 + | +393 | / async fn subsystem_request( +394 | | &mut self, +395 | | channel: ChannelId, +396 | | _name: &str, +... | +399 | | session.channel_failure(channel) +400 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +393 ~ fn subsystem_request( +394 | &mut self, +... +397 | session: &mut Session, +398 ~ ) -> impl Future> { +399 ~ std::future::ready(session.channel_failure(channel)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:412:5 + | +412 | / async fn pty_request( +413 | | &mut self, +414 | | channel: ChannelId, +415 | | _term: &str, +... | +424 | | session.channel_success(channel) +425 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +412 ~ fn pty_request( +413 | &mut self, +... +421 | session: &mut Session, +422 ~ ) -> impl Future> { +423 | self.viewport = Some((col_width, row_height)); +424 ~ std::future::ready(session.channel_success(channel)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:427:5 + | +427 | / async fn window_change_request( +428 | | &mut self, +429 | | channel: ChannelId, +430 | | col_width: u32, +... | +440 | | session.channel_success(channel) +441 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +427 ~ fn window_change_request( +428 | &mut self, +... +434 | session: &mut Session, +435 ~ ) -> impl Future> { +436 | self.viewport = Some((col_width, row_height)); +... +439 | } +440 ~ std::future::ready(session.channel_success(channel)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:443:5 + | +443 | / async fn shell_request( +444 | | &mut self, +445 | | channel: ChannelId, +446 | | session: &mut Session, +... | +512 | | Ok(()) +513 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +443 ~ fn shell_request( +444 | &mut self, +445 | channel: ChannelId, +446 | session: &mut Session, +447 ~ ) -> impl Future> { +448 | let Some(login) = self +... +452 | else { +453 ~ return std::future::ready(session.channel_failure(channel)); +454 | }; +... +459 | let handle = session.handle(); +460 ~ std::future::ready(session.channel_success(channel)?); +461 | let dropped_input = Arc::clone(&self.dropped_input); +... +468 | )); +469 ~ return std::future::ready(Ok(())); +470 | } +471 | let first = join_frame(login); +472 ~ std::future::ready(session.channel_success(channel)?); +473 | let alt_screen = !login.command_mode; +... +511 | }); +512 ~ std::future::ready(Ok(())) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:515:5 + | +515 | / async fn data( +516 | | &mut self, +517 | | _channel: ChannelId, +518 | | data: &[u8], +... | +553 | | Ok(()) +554 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +515 ~ fn data( +516 | &mut self, +... +519 | _session: &mut Session, +520 ~ ) -> impl Future> { +521 | if let Some(exec) = &self.exec { +... +528 | } +529 ~ return std::future::ready(Ok(())); +530 | } +531 | let Some(input) = &self.input else { +532 ~ return std::future::ready(Ok(())); +533 | }; +... +552 | } +553 ~ std::future::ready(Ok(())) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:556:5 + | +556 | / async fn channel_eof( +557 | | &mut self, +558 | | _channel: ChannelId, +559 | | _session: &mut Session, +... | +563 | | Ok(()) +564 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +556 ~ fn channel_eof( +557 | &mut self, +558 | _channel: ChannelId, +559 | _session: &mut Session, +560 ~ ) -> impl Future> { +561 | self.input = None; +562 | self.exec = None; +563 ~ std::future::ready(Ok(())) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:566:5 + | +566 | / async fn channel_close( +567 | | &mut self, +568 | | _channel: ChannelId, +569 | | _session: &mut Session, +... | +573 | | Ok(()) +574 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +566 ~ fn channel_close( +567 | &mut self, +568 | _channel: ChannelId, +569 | _session: &mut Session, +570 ~ ) -> impl Future> { +571 | self.input = None; +572 | self.exec = None; +573 ~ std::future::ready(Ok(())) + | + +warning: use of `Option>` + --> src/world_ssh.rs:690:21 + | +690 | records_prefix: Option>, + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider using `Option`, or a custom enum if you need to distinguish all 3 cases + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#option_option + = note: `-W clippy::option-option` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::option_option)]` + +warning: this `if` statement can be collapsed + --> src/world_ssh.rs:887:9 + | +887 | / ... if let Some((bytes, notice)) = claim_dropped_input_notice(&self... +888 | | ... if self.handle.data(self.channel, notice).await.is_err() { +889 | | ... self.dropped_input.fetch_add(bytes, Ordering::Relaxed); +890 | | ... return false; +891 | | ... } +892 | | ... } + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +887 ~ if let Some((bytes, notice)) = claim_dropped_input_notice(&self.dropped_input) +888 ~ && self.handle.data(self.channel, notice).await.is_err() { +889 | self.dropped_input.fetch_add(bytes, Ordering::Relaxed); +890 | return false; +891 ~ } + | + +warning: variables can be used directly in the `format!` string + --> src/world_ssh.rs:928:21 + | +928 | / ... format!( +929 | | ... "\x1b[H\x1b[2J{}\r\nType a line to chat; /help lists comman... +930 | | ... rendered +931 | | ... ) + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args + +warning: first doc comment paragraph is too long + --> src/world_ssh.rs:995:1 + | +995 | / /// Where `id world join --via ssh` connects: `[user@]host[:port]` (p... +996 | | /// by default; an IPv6 address goes in brackets). The user is only t... +997 | | /// login: on the frame channel it names no world and grants nothing. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_ssh.rs:1016:26 + | +1016 | .map_err(|_| anyhow::anyhow!("`{digits}` is not a port")) + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:1068:5 + | +1068 | / async fn check_server_key( +1069 | | &mut self, +1070 | | key: &russh::keys::PublicKeyOrCertificate, +1071 | | ) -> Result { +... | +1087 | | Ok(trusted) +1088 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +1068 ~ fn check_server_key( +1069 | &mut self, +1070 | key: &russh::keys::PublicKeyOrCertificate, +1071 ~ ) -> impl Future> { +1072 | let russh::keys::PublicKeyOrCertificate::PublicKey { key, .. } = key else { +1073 | self.refuse("a certificate (not supported)".to_owned()); +1074 ~ return std::future::ready(Ok(false)); +1075 | }; + ... +1086 | } +1087 ~ std::future::ready(Ok(trusted)) + | + +warning: unnecessary boolean `not` operation + --> src/world_ssh.rs:1307:17 + | +1307 | / if !self.overflow { +1308 | | let bytes = std::mem::take(&mut self.line); +1309 | | let line = String::from_utf8_lossy(&bytes); +1310 | | if let Some(command) = world_command(&line) { +... | +1314 | | self.line.clear(); +1315 | | } + | |_________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#if_not_else +help: try + | +1307 ~ if self.overflow { +1308 + self.line.clear(); +1309 + } else { +1310 + let bytes = std::mem::take(&mut self.line); +1311 + let line = String::from_utf8_lossy(&bytes); +1312 + if let Some(command) = world_command(&line) { +1313 + commands.push(command); +1314 + } +1315 + } + | + +warning: case-sensitive file extension comparison + --> src/world_ssh.rs:1400:5 + | +1400 | lower.ends_with(".md") || lower.ends_with(".markdown") || lower.en... + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider using a case-insensitive comparison instead + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#case_sensitive_file_extension_comparisons + = note: `-W clippy::case-sensitive-file-extension-comparisons` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::case_sensitive_file_extension_comparisons)]` +help: use std::path::Path + | +1400 ~ std::path::Path::new(&lower) +1401 + .extension() +1402 ~ .is_some_and(|ext| ext.eq_ignore_ascii_case("md")) || lower.ends_with(".markdown") || lower.ends_with(".txt") + | + +warning: case-sensitive file extension comparison + --> src/world_ssh.rs:1400:63 + | +1400 | ..._with(".markdown") || lower.ends_with(".txt") + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider using a case-insensitive comparison instead + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#case_sensitive_file_extension_comparisons +help: use std::path::Path + | +1400 ~ lower.ends_with(".md") || lower.ends_with(".markdown") || std::path::Path::new(&lower) +1401 + .extension() +1402 + .is_some_and(|ext| ext.eq_ignore_ascii_case("txt")) + | + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_ssh.rs:1465:18 + | +1465 | .map_err(|_| DocumentError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: this could be rewritten as `let...else` + --> src/world_ssh.rs:1467:5 + | +1467 | / let size = match store.blobs().status(tag.hash).await { +1468 | | Ok(iroh_blobs::api::blobs::BlobStatus::Complete { size }) =>... +1469 | | _ => return Err(DocumentError::Unavailable), +1470 | | }; + | |______^ help: consider writing: `let Ok(iroh_blobs::api::blobs::BlobStatus::Complete { size }) = store.blobs().status(tag.hash).await else { return Err(DocumentError::Unavailable) };` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_let_else + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_ssh.rs:1478:18 + | +1478 | .map_err(|_| DocumentError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_ssh.rs:1482:52 + | +1482 | let text = std::str::from_utf8(&bytes).map_err(|_| DocumentError::... + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: use of `format!` to build up a string from an iterator + --> src/directory.rs:2051:28 + | +2051 | let kept: String = text + | ____________________________^ +2052 | | .lines() +2053 | | .rev() +2054 | | .skip(1) +... | +2058 | | .map(|line| format!("{line}\n")) +2059 | | .collect(); + | |______________________^ + | +help: call `fold` instead + --> src/directory.rs:2058:14 + | +2058 | .map(|line| format!("{line}\n")) + | ^^^ +help: ... and use the `write!` macro here + --> src/directory.rs:2058:25 + | +2058 | .map(|line| format!("{line}\n")) + | ^^^^^^^^^^^^^^^^^^^ + = note: this can be written more efficiently by appending to a `String` directly + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_collect + = note: `-W clippy::format-collect` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::format_collect)]` + +warning: called `.err().expect()` on a `Result` value + --> src/directory.rs:2716:14 + | +2716 | .err() + | ______________^ +2717 | | .expect("corrupt line must fail"); + | |___________________^ help: try: `expect_err` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#err_expect + = note: `-W clippy::err-expect` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::err_expect)]` + +warning: `to_string()` called on a `&str` + --> src/web/markdown.rs:140:17 + | +140 | return (markdown.to_string(), None); + | ^^^^^^^^^^^^^^^^^^^^ help: try: `markdown.to_owned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#str_to_string + +warning: `to_string()` called on a `&str` + --> src/web/markdown.rs:208:10 + | +208 | (markdown.to_string(), None) + | ^^^^^^^^^^^^^^^^^^^^ help: try: `markdown.to_owned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#str_to_string + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:754:18 + | +754 | /// True for the HtmlBlock comrak's renderer emits between adjacent + | ^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +754 - /// True for the HtmlBlock comrak's renderer emits between adjacent +754 + /// True for the `HtmlBlock` comrak's renderer emits between adjacent + | + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:755:16 + | +755 | /// lists (see collect_block_children). + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +755 - /// lists (see collect_block_children). +755 + /// lists (see `collect_block_children`). + | + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:763:47 + | +763 | /// Convert a comrak list node to one or more ProseMirror list nodes. + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +763 - /// Convert a comrak list node to one or more ProseMirror list nodes. +763 + /// Convert a comrak list node to one or more `ProseMirror` list nodes. + | + +warning: calling `push_str()` using a single-character string literal + --> src/web/markdown.rs:1020:17 + | +1020 | out.push_str("\""); + | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push('"')` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_char_add_str + = note: `-W clippy::single-char-add-str` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::single_char_add_str)]` + +warning: calling `push_str()` using a single-character string literal + --> src/web/markdown.rs:1037:17 + | +1037 | out.push_str("\""); + | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push('"')` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_char_add_str + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:1424:16 + | +1424 | /// subject to CommonMark flanking rules. Link (bracket syntax) and + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1424 - /// subject to CommonMark flanking rules. Link (bracket syntax) and +1424 + /// subject to `CommonMark` flanking rules. Link (bracket syntax) and + | + +warning: this could be a `const fn` + --> src/web/markdown.rs:1426:1 + | +1426 | / fn is_delimiter_wrapper(value: &NodeValue) -> bool { +1427 | | matches!( +1428 | | value, +1429 | | NodeValue::Emph | NodeValue::Strong | NodeValue::Strikethrough +1430 | | ) +1431 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +1426 | const fn is_delimiter_wrapper(value: &NodeValue) -> bool { + | +++++ + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:1603:5 + | +1603 | /// CommonMark flanking rules on reparse and the mark is destroyed. + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1603 - /// CommonMark flanking rules on reparse and the mark is destroyed. +1603 + /// `CommonMark` flanking rules on reparse and the mark is destroyed. + | + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/web/markdown.rs:1653:13 + | +1653 | *url = substitutions[index].0.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `url.clone_from(&substitutions[index].0)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/web/markdown.rs:1660:13 + | +1660 | *url = placeholder.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `url.clone_from(&placeholder)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:1668:17 + | +1668 | /// Used by the footnote_definition save path (#1031) to tell carried + | ^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1668 - /// Used by the footnote_definition save path (#1031) to tell carried +1668 + /// Used by the `footnote_definition` save path (#1031) to tell carried + | + +warning: redundant closure + --> src/web/markdown.rs:1697:25 + | +1697 | .is_none_or(|marks| marks.is_empty()) + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::vec::Vec::is_empty` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_closure_for_method_calls + = note: `-W clippy::redundant-closure-for-method-calls` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_closure_for_method_calls)]` + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:1736:58 + | +1736 | /// Unmarked text runs are written verbatim on save, but CommonMark + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1736 - /// Unmarked text runs are written verbatim on save, but CommonMark +1736 + /// Unmarked text runs are written verbatim on save, but `CommonMark` + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1962:21 + | +1962 | ... tag.push_str(&format!(" alt=\"{}\"", escape_attr_value(alt))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1962 - tag.push_str(&format!(" alt=\"{}\"", escape_attr_value(alt))); +1962 + let _ = write!(tag, " alt=\"{}\"", escape_attr_value(alt)); + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1965:21 + | +1965 | ... tag.push_str(&format!(" title=\"{}\"", escape_attr_value(title))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1965 - tag.push_str(&format!(" title=\"{}\"", escape_attr_value(title))); +1965 + let _ = write!(tag, " title=\"{}\"", escape_attr_value(title)); + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1968:21 + | +1968 | tag.push_str(&format!(" width=\"{w}\"")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1968 - tag.push_str(&format!(" width=\"{w}\"")); +1968 + let _ = write!(tag, " width=\"{w}\""); + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1971:21 + | +1971 | tag.push_str(&format!(" height=\"{h}\"")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1971 - tag.push_str(&format!(" height=\"{h}\"")); +1971 + let _ = write!(tag, " height=\"{h}\""); + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1985:25 + | +1985 | ... anchor.push_str(&format!(" title=\"{}\"", escape_attr_value(link_title))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1985 - anchor.push_str(&format!(" title=\"{}\"", escape_attr_value(link_title))); +1985 + let _ = write!(anchor, " title=\"{}\"", escape_attr_value(link_title)); + | + +warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` + --> src/web/markdown.rs:2084:34 + | +2084 | let target = match paragraph { + | __________________________________^ +2085 | | Some(p) => p, +2086 | | None => { +... | +2096 | | }; + | |_____________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_match_else +help: try + | +2084 ~ let target = if let Some(p) = paragraph { p } else { +2085 + // `&*` reborrows the arena's `&mut` as a shared +2086 + // reference so `p` stays Copy-usable after +2087 + // being stored in `paragraph`. +2088 + let p: &'a AstNode<'a> = +2089 + &*arena.alloc(AstNode::from(NodeValue::Paragraph)); +2090 + ast_node.append(p); +2091 + paragraph = Some(p); +2092 + p +2093 ~ }; + | + +warning: this could be simplified with `bool::then_some` + --> src/web/markdown.rs:2132:32 + | +2132 | ...list = if is_bullet_list { Some(child) } else { None }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_bullet_list.then_some(child)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#if_then_some_else_none + = note: requested on the command line with `-W clippy::if-then-some-else-none` + +warning: this could be a `const fn` + --> src/web/markdown.rs:2208:1 + | +2208 | / fn valid_table_cell_child(value: &NodeValue) -> bool { +2209 | | matches!( +2210 | | value, +2211 | | NodeValue::Text(..) +... | +2232 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +2208 | const fn valid_table_cell_child(value: &NodeValue) -> bool { + | +++++ + +warning: this could be a `const fn` + --> src/web/markdown.rs:2304:1 + | +2304 | / fn is_mark_wrapper(value: &NodeValue) -> bool { +2305 | | matches!( +2306 | | value, +2307 | | NodeValue::Link(..) | NodeValue::Strong | NodeValue::Emph | ... +2308 | | ) +2309 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +2304 | const fn is_mark_wrapper(value: &NodeValue) -> bool { + | +++++ + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:2341:22 + | +2341 | /// (#968). Adjacent ProseMirror runs are converted one at a time, each + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +2341 - /// (#968). Adjacent ProseMirror runs are converted one at a time, each +2341 + /// (#968). Adjacent `ProseMirror` runs are converted one at a time, each + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/web/routes.rs:224:29 + | +224 | || day > month_days[(month - 1) as usize] + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +224 - || day > month_days[(month - 1) as usize] +224 + || day > month_days[usize::try_from(month - 1)] + | + +warning: the loop variable `m` is only used to index `month_days` + --> src/web/routes.rs:238:14 + | +238 | for m in 0..(month.saturating_sub(1) as usize) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_range_loop + = note: `-W clippy::needless-range-loop` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::needless_range_loop)]` +help: consider using an iterator + | +238 - for m in 0..(month.saturating_sub(1) as usize) { +238 + for in month_days.iter().take((month.saturating_sub(1) as usize)) { + | + +warning: redundant closure + --> src/web/routes.rs:333:61 + | +333 | ...ap_or_else(Vec::new, |hub| hub.list()); + | ^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `super::super::world_hub::WorldHub::list` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_closure_for_method_calls + +warning: item in documentation is missing backticks + --> src/web/routes.rs:927:14 + | +927 | /// Returns (paginated_items, clamped_page, clamped_per_page). + | ^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +927 - /// Returns (paginated_items, clamped_page, clamped_per_page). +927 + /// Returns (`paginated_items`, clamped_page, clamped_per_page). + | + +warning: item in documentation is missing backticks + --> src/web/routes.rs:927:31 + | +927 | /// Returns (paginated_items, clamped_page, clamped_per_page). + | ^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +927 - /// Returns (paginated_items, clamped_page, clamped_per_page). +927 + /// Returns (paginated_items, `clamped_page`, clamped_per_page). + | + +warning: item in documentation is missing backticks + --> src/web/routes.rs:927:45 + | +927 | /// Returns (paginated_items, clamped_page, clamped_per_page). + | ^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +927 - /// Returns (paginated_items, clamped_page, clamped_per_page). +927 + /// Returns (paginated_items, clamped_page, `clamped_per_page`). + | + +warning: these match arms have identical bodies + --> src/web/routes.rs:2110:13 + | +2110 | ... "paragraph" | "heading" => lines.push(extract_inline_text(node)), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2111 | ... "code_block" => lines.push(extract_inline_text(node)), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +2110 - "paragraph" | "heading" => lines.push(extract_inline_text(node)), +2111 - "code_block" => lines.push(extract_inline_text(node)), +2110 + "paragraph" | "heading" | "code_block" => lines.push(extract_inline_text(node)), + | + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:462:5 + | +462 | pub fn update(&mut self, participant: u64, event: &[u8]) -> Result<()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `update` defined here + --> src/sandbox.rs:836:5 + | +836 | fn update(&mut self, event: &crate::world::WorldEvent) -> Result<()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + = note: requested on the command line with `-W clippy::same-name-method` + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:507:5 + | +507 | pub fn view(&mut self) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `view` defined here + --> src/sandbox.rs:853:5 + | +853 | fn view(&mut self, _viewer: &crate::world::Participant) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:580:5 + | +580 | pub fn records(&mut self) -> Result>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `records` defined here + --> src/sandbox.rs:872:5 + | +872 | fn records(&mut self) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:610:5 + | +610 | pub fn wants(&mut self) -> Result>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `wants` defined here + --> src/sandbox.rs:878:5 + | +878 | fn wants(&mut self) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:641:5 + | +641 | pub fn snapshot(&mut self) -> Result>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `snapshot` defined here + --> src/sandbox.rs:888:5 + | +888 | fn snapshot(&mut self) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + +warning: unused `async` for function with no await statements + --> src/world/actor.rs:360:5 + | +360 | / async fn deliver(&mut self, text: String) -> bool { +361 | | if !self.program_healthy || self.storage_failed { +362 | | return false; +... | +394 | | journaled +395 | | } + | |_____^ + | + = help: consider removing the `async` from this function + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async + = note: `-W clippy::unused-async` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_async)]` + +warning: unused `async` for function with no await statements + --> src/world/actor.rs:1398:5 + | +1398 | / async fn compact_if_due(&mut self) { +1399 | | if self.compaction_off +1400 | | || self.storage_failed +1401 | | || !self.program_healthy +... | +1420 | | } + | |_____^ + | + = help: consider removing the `async` from this function + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async + +warning: this parameter is a mutable reference but is not used mutably + --> src/world/actor.rs:352:20 + | +352 | fn republished(&mut self, records: Records, sequence: u64) { + | ^----^^^^ + | | + | help: consider removing this `mut` + | + = note: this is cfg-gated and may require further changes + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_ref_mut + = note: `-W clippy::needless-pass-by-ref-mut` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::needless_pass_by_ref_mut)]` + +warning: very complex type used. Consider factoring parts into `type` definitions + --> src/event_store/ingest.rs:1142:36 + | +1142 | ...ventStore) -> (Vec>, Vec<(Vec, Vec)>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#type_complexity + = note: `-W clippy::type-complexity` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::type_complexity)]` + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/ingest.rs:2583:24 + | +2583 | for seq in 0..=(rng.below(3) as SeqNum) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation + = note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]` +help: ... or use `try_from` and handle the error accordingly + | +2583 - for seq in 0..=(rng.below(3) as SeqNum) { +2583 + for seq in 0..=SeqNum::try_from(rng.below(3)) { + | + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/ingest.rs:2592:28 + | +2592 | for seq in 0..=(rng.below(3) as SeqNum) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2592 - for seq in 0..=(rng.below(3) as SeqNum) { +2592 + for seq in 0..=SeqNum::try_from(rng.below(3)) { + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2595:33 + | +2595 | let named = rng.below(anchor.len() as u64) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2595 - let named = rng.below(anchor.len() as u64) as usize; +2595 + let named = usize::try_from(rng.below(anchor.len() as u64)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2607:23 + | +2607 | let who = rng.below(3) as usize; + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2607 - let who = rng.below(3) as usize; +2607 + let who = usize::try_from(rng.below(3)); + | + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/ingest.rs:2609:23 + | +2609 | let seq = rng.below(chain.len() as u64) as SeqNum; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2609 - let seq = rng.below(chain.len() as u64) as SeqNum; +2609 + let seq = SeqNum::try_from(rng.below(chain.len() as u64)); + | + +warning: casting `usize` to `u8` may truncate the value + --> src/event_store/ingest.rs:2611:41 + | +2611 | ... let rival = event(&key(20 + who as u8), seq, backlink, Vec::new(... + | ^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2611 - let rival = event(&key(20 + who as u8), seq, backlink, Vec::new(), "rival"); +2611 + let rival = event(&key(20 + u8::try_from(who)), seq, backlink, Vec::new(), "rival"); + | + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/ingest.rs:2616:24 + | +2616 | for seq in 0..=(rng.below(3) as SeqNum) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2616 - for seq in 0..=(rng.below(3) as SeqNum) { +2616 + for seq in 0..=SeqNum::try_from(rng.below(3)) { + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2618:26 + | +2618 | let target = rng.below(all.len() as u64) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2618 - let target = rng.below(all.len() as u64) as usize; +2618 + let target = usize::try_from(rng.below(all.len() as u64)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2624:28 + | +2624 | let copy = all[rng.below(all.len() as u64) as usize].clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2624 - let copy = all[rng.below(all.len() as u64) as usize].clone(); +2624 + let copy = all[usize::try_from(rng.below(all.len() as u64))].clone(); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2628:21 + | +2628 | let j = rng.below(i as u64 + 1) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2628 - let j = rng.below(i as u64 + 1) as usize; +2628 + let j = usize::try_from(rng.below(i as u64 + 1)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2670:33 + | +2670 | let take = (1 + rng.below(6) as usize).min(rest.len()); + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2670 - let take = (1 + rng.below(6) as usize).min(rest.len()); +2670 + let take = (1 + usize::try_from(rng.below(6))).min(rest.len()); + | + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> src/event_store/range.rs:277:15 + | +277 | (out, (hi - lo) as u32) + | ^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +277 - (out, (hi - lo) as u32) +277 + (out, u32::try_from(hi - lo)) + | + +warning: use of `format!` to build up a string from an iterator + --> src/event_store/range.rs:807:9 + | +807 | bytes.iter().map(|b| format!("{b:02x}")).collect() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: call `fold` instead + --> src/event_store/range.rs:807:22 + | +807 | bytes.iter().map(|b| format!("{b:02x}")).collect() + | ^^^ +help: ... and use the `write!` macro here + --> src/event_store/range.rs:807:30 + | +807 | bytes.iter().map(|b| format!("{b:02x}")).collect() + | ^^^^^^^^^^^^^^^^^^ + = note: this can be written more efficiently by appending to a `String` directly + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_collect + +warning: unnecessary use of `clone` to create a slice from a reference + --> src/event_store/range.rs:899:38 + | +899 | ...spond(&[root.clone()], Params::new(2, 40).unwrap(), &mut learned); + | ^^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&root)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cloned_ref_to_slice_refs + = note: `-W clippy::cloned-ref-to-slice-refs` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::cloned_ref_to_slice_refs)]` + +warning: unnecessary use of `clone` to create a slice from a reference + --> src/event_store/range.rs:906:39 + | +906 | ...spond(&[root.clone()], Params::new(4, 39).unwrap(), &mut learned); + | ^^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&root)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cloned_ref_to_slice_refs + +warning: unnecessary use of `clone` to create a slice from a reference + --> src/event_store/range.rs:910:40 + | +910 | ...spond(&[root.clone()], Params::new(2, 1).unwrap(), &mut learned); + | ^^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&root)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cloned_ref_to_slice_refs + +warning: very complex type used. Consider factoring parts into `type` definitions + --> src/event_store/sync.rs:911:30 + | +911 | fn lengths(seed: u32) -> (Vec<(u64, u32)>, Vec<(u64, u32)>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#type_complexity + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/sync.rs:913:27 + | +913 | .map(|c| (c, (c as u32 * (7 + seed)) % 19)) + | ^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +913 - .map(|c| (c, (c as u32 * (7 + seed)) % 19)) +913 + .map(|c| (c, (u32::try_from(c) * (7 + seed)) % 19)) + | + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/sync.rs:916:27 + | +916 | .map(|c| (c, (c as u32 * (5 + seed) + 3) % 23)) + | ^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +916 - .map(|c| (c, (c as u32 * (5 + seed) + 3) % 23)) +916 + .map(|c| (c, (u32::try_from(c) * (5 + seed) + 3) % 23)) + | + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> src/event_store/sync.rs:932:36 + | +932 | let (la, lb) = lengths(seed as u32); + | ^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +932 - let (la, lb) = lengths(seed as u32); +932 + let (la, lb) = lengths(u32::try_from(seed)); + | + +warning: using `.clone()` on a ref-counted pointer + --> src/event_sync.rs:241:50 + | +241 | .accept(ALPN, EventSyncProtocol::new(b.clone())) + | ^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&b)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + = note: requested on the command line with `-W clippy::clone-on-ref-ptr` + +warning: using `.clone()` on a ref-counted pointer + --> src/event_sync.rs:280:50 + | +280 | .accept(ALPN, EventSyncProtocol::new(b.clone())) + | ^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&b)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: redundant clone + --> src/groups/worlds.rs:553:45 + | +553 | let mut reversed = ledger.events.clone(); + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> src/groups/worlds.rs:553:32 + | +553 | let mut reversed = ledger.events.clone(); + | ^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + = note: `-W clippy::redundant-clone` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::redundant_clone)]` + +warning: `id` (lib) generated 264 warnings (run `cargo clippy --fix --lib -p id -- ` to apply 77 suggestions) +warning: casting `usize` to `u8` may truncate the value + --> src/log_sync.rs:961:50 + | +961 | tx.try_send(Arrival::Header(vec![n as u8])).unwrap(); + | ^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +961 - tx.try_send(Arrival::Header(vec![n as u8])).unwrap(); +961 + tx.try_send(Arrival::Header(vec![u8::try_from(n)])).unwrap(); + | + +warning: casting `usize` to `u8` may truncate the value + --> src/log_sync.rs:1007:46 + | +1007 | tx.try_send(Arrival::Header(vec![(n % 251) as u8])).unwrap(); + | ^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +1007 - tx.try_send(Arrival::Header(vec![(n % 251) as u8])).unwrap(); +1007 + tx.try_send(Arrival::Header(vec![u8::try_from(n % 251)])).unwrap(); + | + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/log_sync.rs:1075:9 + | +1075 | const REFUSALS: usize = BATCH_MAX_ARRIVALS + 10; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> src/log_sync.rs:1087:35 + | +1087 | ... assert_eq!(tally.refused, REFUSALS as u32, "every refusal is tal... + | ^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +1087 - assert_eq!(tally.refused, REFUSALS as u32, "every refusal is tallied"); +1087 + assert_eq!(tally.refused, u32::try_from(REFUSALS), "every refusal is tallied"); + | + +warning: casting `i32` to `u64` may lose the sign of the value + --> tests/cli_warnings.rs:135:42 + | +135 | member_key[..8].copy_from_slice(&(i as u64).to_be_bytes()); + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_sign_loss + = note: `-W clippy::cast-sign-loss` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_sign_loss)]` + +warning: casting `i32` to `u64` may lose the sign of the value + --> tests/cli_warnings.rs:195:42 + | +195 | member_key[..8].copy_from_slice(&(i as u64).to_be_bytes()); + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_sign_loss + +warning: casting `i32` to `u64` may lose the sign of the value + --> tests/cli_warnings.rs:215:42 + | +215 | member_key[..8].copy_from_slice(&(i as u64).to_be_bytes()); + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_sign_loss + +warning: `id` (test "cli_warnings") generated 3 warnings +warning: item in documentation is missing backticks + --> tests/membership_properties.rs:18:5 + | +18 | /// SplitMix64. A scenario is a pure function of its seed. + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown + = note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]` +help: try + | +18 - /// SplitMix64. A scenario is a pure function of its seed. +18 + /// `SplitMix64`. A scenario is a pure function of its seed. + | + +warning: this could be a `const fn` + --> tests/membership_properties.rs:22:5 + | +22 | / fn next_u64(&mut self) -> u64 { +23 | | self.0 = self.0.wrapping_add(0x9E37_79B9_7F4A_7C15); +24 | | let mut z = self.0; +25 | | z = (z ^ (z >> 30)).wrapping_mul(0xBF58_476D_1CE4_E5B9); +26 | | z = (z ^ (z >> 27)).wrapping_mul(0x94D0_49BB_1331_11EB); +27 | | z ^ (z >> 31) +28 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn + = note: `-W clippy::missing-const-for-fn` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::missing_const_for_fn)]` +help: make the function `const` + | +22 | const fn next_u64(&mut self) -> u64 { + | +++++ + +warning: casting `u64` to `u8` may truncate the value + --> tests/membership_properties.rs:57:19 + | +57 | Hash::digest([n as u8]) + | ^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation + = note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]` +help: ... or use `try_from` and handle the error accordingly + | +57 - Hash::digest([n as u8]) +57 + Hash::digest([u8::try_from(n)]) + | + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> tests/membership_properties.rs:66:31 + | +66 | let id = Hash::digest((i as u32).to_be_bytes()); + | ^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +66 - let id = Hash::digest((i as u32).to_be_bytes()); +66 + let id = Hash::digest(u32::try_from(i).to_be_bytes()); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/membership_properties.rs:71:35 + | +71 | let pick = events[rng.below(i as u64) as usize].id; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +71 - let pick = events[rng.below(i as u64) as usize].id; +71 + let pick = events[usize::try_from(rng.below(i as u64))].id; + | + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> tests/membership_properties.rs:182:18 + | +182 | Hash::digest((i as u32).to_be_bytes()) + | ^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +182 - Hash::digest((i as u32).to_be_bytes()) +182 + Hash::digest(u32::try_from(i).to_be_bytes()) + | + +warning: this could be a `const fn` + --> tests/membership_properties.rs:185:1 + | +185 | / fn key(n: u64) -> AuthId { +186 | | AuthId::Key([n as u8; 32]) +187 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +185 | const fn key(n: u64) -> AuthId { + | +++++ + +warning: casting `u64` to `u8` may truncate the value + --> tests/membership_properties.rs:186:18 + | +186 | AuthId::Key([n as u8; 32]) + | ^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +186 - AuthId::Key([n as u8; 32]) +186 + AuthId::Key([u8::try_from(n); 32]) + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/membership_properties.rs:222:35 + | +222 | let pick = events[rng.below(i as u64) as usize].id; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +222 - let pick = events[rng.below(i as u64) as usize].id; +222 + let pick = events[usize::try_from(rng.below(i as u64))].id; + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/membership_properties.rs:236:32 + | +236 | let group = groups[rng.below(groups.len() as u64) as usize]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +236 - let group = groups[rng.below(groups.len() as u64) as usize]; +236 + let group = groups[usize::try_from(rng.below(groups.len() as u64))]; + | + +warning: casting `u64` to `u8` may truncate the value + --> tests/membership_properties.rs:257:30 + | +257 | author: [1 + rng.below(4) as u8; 32], + | ^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +257 - author: [1 + rng.below(4) as u8; 32], +257 + author: [1 + u8::try_from(rng.below(4)); 32], + | + +warning: very complex type used. Consider factoring parts into `type` definitions + --> tests/membership_properties.rs:277:14 + | +277 | members: Vec<(Hash, Vec<(AuthId, Access<()>)>)>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#type_complexity + = note: `-W clippy::type-complexity` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::type_complexity)]` + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/membership_properties.rs:318:17 + | +318 | let j = rng.below(i as u64 + 1) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +318 - let j = rng.below(i as u64 + 1) as usize; +318 + let j = usize::try_from(rng.below(i as u64 + 1)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/membership_properties.rs:345:30 + | +345 | let repeat = rng.below(events.len() as u64) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +345 - let repeat = rng.below(events.len() as u64) as usize; +345 + let repeat = usize::try_from(rng.below(events.len() as u64)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/membership_properties.rs:346:26 + | +346 | let at = rng.below(arrivals.len() as u64 + 1) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +346 - let at = rng.below(arrivals.len() as u64 + 1) as usize; +346 + let at = usize::try_from(rng.below(arrivals.len() as u64 + 1)); + | + +warning: `id` (test "membership_properties") generated 15 warnings (run `cargo clippy --fix --test "membership_properties" -p id -- ` to apply 3 suggestions) +warning: used `assert_eq!` with a literal bool + --> tests/world_roles.rs:40:5 + | +40 | / assert_eq!( +41 | | WorldScopes::from_role("builder").unwrap().is_builder(), +42 | | true +43 | | ); + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#bool_assert_comparison + = note: `-W clippy::bool-assert-comparison` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::bool_assert_comparison)]` +help: replace it with `assert!(..)` + | +40 ~ assert!( +41 ~ WorldScopes::from_role("builder").unwrap().is_builder() + | + +warning: used `assert_eq!` with a literal bool + --> tests/world_roles.rs:44:5 + | +44 | / assert_eq!( +45 | | WorldScopes::from_role("moderator").unwrap().is_moderator(), +46 | | true +47 | | ); + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#bool_assert_comparison +help: replace it with `assert!(..)` + | +44 ~ assert!( +45 ~ WorldScopes::from_role("moderator").unwrap().is_moderator() + | + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1171:9 + | +1171 | / fn wants_of(chat: &mut WorldInstance) -> String { +1172 | | crate::world::WorldProgram::wants(chat).unwrap().unwrap() +1173 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1174:9 + | +1174 | / fn send(chat: &mut WorldInstance, ev: &[u8]) { +1175 | | crate::world::WorldProgram::update( +1176 | | chat, +1177 | | &WorldEvent { +... | +1183 | | .unwrap(); +1184 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1185:9 + | +1185 | / fn host(chat: &mut WorldInstance, event: serde_json::Value) { +1186 | | crate::world::WorldProgram::update( +1187 | | chat, +1188 | | &WorldEvent { +... | +1196 | | .unwrap(); +1197 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1198:9 + | +1198 | / fn view(chat: &mut WorldInstance) -> String { +1199 | | String::from_utf8(chat.view().unwrap()).unwrap() +1200 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: this argument is passed by value, but not consumed in the function body + --> src/sandbox.rs:1185:50 + | +1185 | fn host(chat: &mut WorldInstance, event: serde_json::Value) { + | ^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +1185 | fn host(chat: &mut WorldInstance, event: &serde_json::Value) { + | + + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1482:9 + | +1482 | / fn wants_of(lounge: &mut WorldInstance) -> String { +1483 | | crate::world::WorldProgram::wants(lounge) +1484 | | .unwrap() +1485 | | .context("the lounge exports wants") +1486 | | .unwrap() +1487 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: `id` (test "world_roles") generated 2 warnings (run `cargo clippy --fix --test "world_roles" -p id -- ` to apply 2 suggestions) +warning: very complex type used. Consider factoring parts into `type` definitions + --> src/search.rs:106:22 + | +106 | ...d: Vec<(BTreeSet<[u8; 32]>, BTreeMap<[u8; 32], BTreeSet<[u8; 32]>>)> = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#type_complexity + +warning: deref on an immutable reference + --> tests/retention_pruning.rs:358:20 + | +358 | .chain(&*key(4).verifying_key().as_bytes()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `key(4).verifying_key().as_bytes()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#borrow_deref_ref + = note: `-W clippy::borrow-deref-ref` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::borrow_deref_ref)]` + +warning: deref on an immutable reference + --> tests/retention_pruning.rs:373:20 + | +373 | .chain(&*key(4).verifying_key().as_bytes()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `key(4).verifying_key().as_bytes()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#borrow_deref_ref + +warning: deref on an immutable reference + --> tests/retention_pruning.rs:433:16 + | +433 | .chain(&*key(2).verifying_key().as_bytes()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `key(2).verifying_key().as_bytes()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#borrow_deref_ref + +warning: `id` (test "retention_pruning") generated 3 warnings (run `cargo clippy --fix --test "retention_pruning" -p id -- ` to apply 3 suggestions) +warning: using `.clone()` on a ref-counted pointer + --> src/world/actor.rs:620:23 + | +620 | let records = self.records_sender.borrow().1.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&self.records_sender.borrow().1)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` + --> src/world/actor.rs:1437:23 + | +1437 | let initial = match program_records(program.as_mut()) { + | _______________________^ +1438 | | Ok(records) => records.unwrap_or_default(), +1439 | | Err(_) => { +1440 | | program_healthy = false; +... | +1443 | | }; + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_match_else +help: try + | +1437 ~ let initial = if let Ok(records) = program_records(program.as_mut()) { records.unwrap_or_default() } else { +1438 + program_healthy = false; +1439 + Records::new() +1440 ~ }; + | + +warning: large future with a size of 19360 bytes + --> src/main.rs:285:44 + | +285 | ...rld_cmd)) => id::commands::cmd_world(*world_cmd).await, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Box::pin` on it: `Box::pin(id::commands::cmd_world(*world_cmd))` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#large_futures + = note: `-W clippy::large-futures` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::large_futures)]` + +warning: `id` (bin "id" test) generated 1 warning +warning: module has the same name as its containing module + --> src/world/tests.rs:7:1 + | + 7 | / mod tests { + 8 | | use super::*; + 9 | | + 10 | | fn world(retained_events: usize) -> WorldCore { +... | +2498 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#module_inception + = note: `-W clippy::module-inception` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::module_inception)]` + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:685:72 + | +685 | ...ldLimits::default(), clock.clone()).unwrap(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:731:72 + | +731 | ...ldLimits::default(), clock.clone()).unwrap(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:802:83 + | +802 | ...ldLimits::default(), clock.clone()) + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:1039:80 + | +1039 | ...ldLimits::default(), clock.clone()) + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:3259:67 + | +3259 | ...ldLimits::default(), clock.clone()).unwrap(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:3291:9 + | +3291 | actor.records_sender.borrow().1.clone() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&actor.records_sender.borrow().1)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:3609:22 + | +3609 | core.clock = clock.clone(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:3644:22 + | +3644 | core.clock = clock.clone(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: item in documentation is missing backticks + --> tests/event_store_properties.rs:32:5 + | +32 | /// SplitMix64. A scenario is a pure function of its seed. + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown + = note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]` +help: try + | +32 - /// SplitMix64. A scenario is a pure function of its seed. +32 + /// `SplitMix64`. A scenario is a pure function of its seed. + | + +warning: this could be a `const fn` + --> tests/event_store_properties.rs:36:5 + | +36 | / fn next_u64(&mut self) -> u64 { +37 | | self.0 = self.0.wrapping_add(0x9E37_79B9_7F4A_7C15); +38 | | let mut z = self.0; +39 | | z = (z ^ (z >> 30)).wrapping_mul(0xBF58_476D_1CE4_E5B9); +40 | | z = (z ^ (z >> 27)).wrapping_mul(0x94D0_49BB_1331_11EB); +41 | | z ^ (z >> 31) +42 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn + = note: `-W clippy::missing-const-for-fn` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::missing_const_for_fn)]` +help: make the function `const` + | +36 | const fn next_u64(&mut self) -> u64 { + | +++++ + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:105:19 + | +105 | known[rng.below(known.len() as u64) as usize].id + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation + = note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]` +help: ... or use `try_from` and handle the error accordingly + | +105 - known[rng.below(known.len() as u64) as usize].id +105 + known[usize::try_from(rng.below(known.len() as u64))].id + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:127:46 + | +127 | ... => Some(known[rng.below(known.len() as u64) as usize].id), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +127 - 2 if !known.is_empty() => Some(known[rng.below(known.len() as u64) as usize].id), +127 + 2 if !known.is_empty() => Some(known[usize::try_from(rng.below(known.len() as u64))].id), + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:179:21 + | +179 | let count = 2 + rng.below(2) as usize; + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +179 - let count = 2 + rng.below(2) as usize; +179 + let count = 2 + usize::try_from(rng.below(2)); + | + +warning: casting `u64` to `u8` may truncate the value + --> tests/event_store_properties.rs:181:66 + | +181 | ...std::array::from_fn(|_| rng.next_u64() as u8))) + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +181 - .map(|_| SigningKey::from_bytes(&std::array::from_fn(|_| rng.next_u64() as u8))) +181 + .map(|_| SigningKey::from_bytes(&std::array::from_fn(|_| u8::try_from(rng.next_u64())))) + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:196:45 + | +196 | plan.insert(*public, (fork, 1 + rng.below(2) as usize)); + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +196 - plan.insert(*public, (fork, 1 + rng.below(2) as usize)); +196 + plan.insert(*public, (fork, 1 + usize::try_from(rng.below(2)))); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:204:22 + | +204 | let author = rng.below(count as u64) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +204 - let author = rng.below(count as u64) as usize; +204 + let author = usize::try_from(rng.below(count as u64)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:246:21 + | +246 | let count = 2 + rng.below(3) as usize; + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +246 - let count = 2 + rng.below(3) as usize; +246 + let count = 2 + usize::try_from(rng.below(3)); + | + +warning: casting `u64` to `u8` may truncate the value + --> tests/event_store_properties.rs:248:66 + | +248 | ...std::array::from_fn(|_| rng.next_u64() as u8))) + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +248 - .map(|_| SigningKey::from_bytes(&std::array::from_fn(|_| rng.next_u64() as u8))) +248 + .map(|_| SigningKey::from_bytes(&std::array::from_fn(|_| u8::try_from(rng.next_u64())))) + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:254:19 + | +254 | let forkers = rng.below(count as u64) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +254 - let forkers = rng.below(count as u64) as usize; +254 + let forkers = usize::try_from(rng.below(count as u64)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:271:22 + | +271 | let author = rng.below(count as u64) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +271 - let author = rng.below(count as u64) as usize; +271 + let author = usize::try_from(rng.below(count as u64)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:314:25 + | +314 | let hash = good[rng.below(good.len() as u64) as usize].id; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +314 - let hash = good[rng.below(good.len() as u64) as usize].id; +314 + let hash = good[usize::try_from(rng.below(good.len() as u64))].id; + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> tests/event_store_properties.rs:431:17 + | +431 | let j = rng.below(i as u64 + 1) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +431 - let j = rng.below(i as u64 + 1) as usize; +431 + let j = usize::try_from(rng.below(i as u64 + 1)); + | + +warning: use of `format!` to build up a string from an iterator + --> tests/event_store_properties.rs:782:5 + | +782 | bytes.iter().map(|byte| format!("\\x{byte:02x}")).collect() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: call `fold` instead + --> tests/event_store_properties.rs:782:18 + | +782 | bytes.iter().map(|byte| format!("\\x{byte:02x}")).collect() + | ^^^ +help: ... and use the `write!` macro here + --> tests/event_store_properties.rs:782:29 + | +782 | bytes.iter().map(|byte| format!("\\x{byte:02x}")).collect() + | ^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this can be written more efficiently by appending to a `String` directly + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_collect + = note: `-W clippy::format-collect` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::format_collect)]` + +warning: redundant clone + --> tests/event_store_properties.rs:871:31 + | +871 | a2_rival.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:871:17 + | +871 | a2_rival.bytes.clone(), + | ^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + = note: `-W clippy::redundant-clone` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::redundant_clone)]` + +warning: redundant clone + --> tests/event_store_properties.rs:885:34 + | +885 | b0_after_a1.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:885:17 + | +885 | b0_after_a1.bytes.clone(), + | ^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:904:34 + | +904 | b0_after_a0.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:904:17 + | +904 | b0_after_a0.bytes.clone(), + | ^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:905:31 + | +905 | a0_rival.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:905:17 + | +905 | a0_rival.bytes.clone(), + | ^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:910:68 + | +910 | ...one(), a1_stray.bytes.clone()], + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:910:54 + | +910 | ... vec![a0.bytes.clone(), a1.bytes.clone(), a1_stray.bytes.clone()], + | ^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:916:31 + | +916 | a1_rival.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:916:17 + | +916 | a1_rival.bytes.clone(), + | ^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:917:30 + | +917 | a1_held.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:917:17 + | +917 | a1_held.bytes.clone(), + | ^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:925:25 + | +925 | a2.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:925:17 + | +925 | a2.bytes.clone(), + | ^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:926:31 + | +926 | a2_stray.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:926:17 + | +926 | a2_stray.bytes.clone(), + | ^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:931:50 + | +931 | vec![b0.bytes.clone(), a2_on_b0.bytes.clone()], + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:931:36 + | +931 | vec![b0.bytes.clone(), a2_on_b0.bytes.clone()], + | ^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:936:25 + | +936 | a0.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:936:17 + | +936 | a0.bytes.clone(), + | ^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: redundant clone + --> tests/event_store_properties.rs:937:25 + | +937 | a1.bytes.clone(), + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/event_store_properties.rs:937:17 + | +937 | a1.bytes.clone(), + | ^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: `id` (test "event_store_properties") generated 27 warnings (run `cargo clippy --fix --test "event_store_properties" -p id -- ` to apply 14 suggestions) +warning: unnecessary qualification + --> tests/cli_integration.rs:1865:19 + | +1865 | ... let pem = std::fs::read_to_string(server_dir.path().join(id::wor... + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: requested on the command line with `-W unused-qualifications` +help: remove the unnecessary path segments + | +1865 - let pem = std::fs::read_to_string(server_dir.path().join(id::world_ssh::SSH_HOST_KEY_FILE)) +1865 + let pem = fs::read_to_string(server_dir.path().join(id::world_ssh::SSH_HOST_KEY_FILE)) + | + +warning: unnecessary qualification + --> tests/cli_integration.rs:1976:19 + | +1976 | ... let pem = std::fs::read_to_string(server_dir.path().join(id::wor... + | ^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1976 - let pem = std::fs::read_to_string(server_dir.path().join(id::world_ssh::SSH_HOST_KEY_FILE)) +1976 + let pem = fs::read_to_string(server_dir.path().join(id::world_ssh::SSH_HOST_KEY_FILE)) + | + +warning: calling `std::fs::create_dir` where there may be a better way + --> src/world_compile.rs:697:9 + | +697 | std::fs::create_dir(root.path().join("empty")).unwrap(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#create_dir + = note: requested on the command line with `-W clippy::create-dir` +help: consider calling `std::fs::create_dir_all` instead + | +697 | std::fs::create_dir_all(root.path().join("empty")).unwrap(); + | ++++ + +warning: this could be a `const fn` + --> tests/multidevice.rs:20:1 + | +20 | / fn key(n: u8) -> Key { +21 | | [n; 32] +22 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn + = note: `-W clippy::missing-const-for-fn` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::missing_const_for_fn)]` +help: make the function `const` + | +20 | const fn key(n: u8) -> Key { + | +++++ + +warning: called `map().unwrap_or_else()` on an `Option` value + --> tests/cli_integration.rs:41:5 + | +41 | / std::env::var_os("ID_TEST_EXAMPLES_DIR") +42 | | .map(PathBuf::from) +43 | | .unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("examples")) + | |______________________________________________________________________________________^ help: try: `std::env::var_os("ID_TEST_EXAMPLES_DIR").map_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("examples"), PathBuf::from)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or + = note: `-W clippy::map-unwrap-or` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::map_unwrap_or)]` + +warning: `id` (test "multidevice") generated 1 warning (run `cargo clippy --fix --test "multidevice" -p id -- ` to apply 1 suggestion) +warning: used `assert!` with an equality comparison + --> tests/cli_integration.rs:997:9 + | +997 | assert!(output.trim() == "2"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_assert_eq + = note: `-W clippy::manual-assert-eq` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_assert_eq)]` +help: replace it with `assert_eq!(..)` + | +997 - assert!(output.trim() == "2"); +997 + assert_eq!(output.trim(), "2"); + | + +warning: used `assert!` with an equality comparison + --> tests/cli_integration.rs:1016:9 + | +1016 | assert!(output.trim() == "2"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_assert_eq +help: replace it with `assert_eq!(..)` + | +1016 - assert!(output.trim() == "2"); +1016 + assert_eq!(output.trim(), "2"); + | + +warning: used `assert!` with an equality comparison + --> tests/cli_integration.rs:1033:9 + | +1033 | assert!(output.trim() == "3"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_assert_eq +help: replace it with `assert_eq!(..)` + | +1033 - assert!(output.trim() == "3"); +1033 + assert_eq!(output.trim(), "3"); + | + +warning: used `assert!` with an equality comparison + --> tests/cli_integration.rs:1108:9 + | +1108 | assert!(output.trim() == "4"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_assert_eq +help: replace it with `assert_eq!(..)` + | +1108 - assert!(output.trim() == "4"); +1108 + assert_eq!(output.trim(), "4"); + | + +warning: used `assert!` with an equality comparison + --> tests/cli_integration.rs:1128:9 + | +1128 | assert!(output.trim() == "1"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_assert_eq +help: replace it with `assert_eq!(..)` + | +1128 - assert!(output.trim() == "1"); +1128 + assert_eq!(output.trim(), "1"); + | + +warning: used `assert!` with an equality comparison + --> tests/cli_integration.rs:1160:9 + | +1160 | assert!(output.trim() == "2"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_assert_eq +help: replace it with `assert_eq!(..)` + | +1160 - assert!(output.trim() == "2"); +1160 + assert_eq!(output.trim(), "2"); + | + +warning: using `.clone()` on a ref-counted pointer + --> src/world_hub.rs:831:44 + | +831 | let opener: Arc = opener.clone(); + | ^^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(opener)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: redundant clone + --> tests/cli_integration.rs:2020:28 + | +2020 | let target = listen.clone(); + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/cli_integration.rs:2020:22 + | +2020 | let target = listen.clone(); + | ^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + = note: `-W clippy::redundant-clone` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::redundant_clone)]` + +warning: used underscore-prefixed binding + --> src/world_hub.rs:1167:14 + | +1167 | drop(_b); + | ^^ + | +note: binding is defined here + --> src/world_hub.rs:1153:13 + | +1153 | let _b = hub.lease(Some("b"), Some("admin")).await.unwrap(); + | ^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#used_underscore_binding + +warning: this `continue` expression is redundant + --> tests/cli_integration.rs:2881:31 + | +2881 | Err(_) => continue, + | ^^^^^^^^ + | + = help: consider dropping the `continue` expression + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_continue + = note: `-W clippy::needless-continue` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_continue)]` + +warning: called `map().unwrap_or()` on a `Result` value + --> tests/cli_integration.rs:3409:31 + | +3409 | ...t = fs::read_dir(&store_path).map(Iterator::count).unwrap_or(0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or +help: use `map_or(, )` instead + | +3409 - let entry_count = fs::read_dir(&store_path).map(Iterator::count).unwrap_or(0); +3409 + let entry_count = fs::read_dir(&store_path).map_or(0, Iterator::count); + | + +warning: redundant clone + --> src/world_manifest.rs:665:32 + | +665 | let mut applied = state.clone(); + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> src/world_manifest.rs:665:27 + | +665 | let mut applied = state.clone(); + | ^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_native.rs:995:26 + | +995 | .map_err(|_| "worker gone".to_owned())?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `id` (test "cli_integration") generated 12 warnings (run `cargo clippy --fix --test "cli_integration" -p id -- ` to apply 11 suggestions) +warning: using `.clone()` on a ref-counted pointer + --> src/world_net.rs:1777:66 + | +1777 | ..._hub::WorldOpener> = opener.clone(); + | ^^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&opener)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: `id` (bin "id") generated 1 warning (1 duplicate) +warning: this argument is passed by value, but not consumed in the function body + --> src/world_presentation.rs:519:22 + | +519 | fn screen(value: Value) -> Result> { + | ^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +519 | fn screen(value: &Value) -> Result> { + | + + +warning: 5 bindings with single-character names in scope + --> tests/tag_claims.rs:188:13 + | +188 | let mut a = Writer::new(1); + | ^ +189 | let mut b = Writer::new(2); + | ^ +190 | let mut c = Writer::new(3); + | ^ +191 | let x = a.send(&set(s1, "city", Some("Seattle")), vec![], 0); + | ^ +192 | let y = b.send(&set(s2, "seen", None), vec![x.id()], 1); + | ^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#many_single_char_names + = note: `-W clippy::many-single-char-names` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::many_single_char_names)]` + +warning: binding's name is too similar to existing binding + --> tests/tag_claims.rs:342:21 + | +342 | ... let seen: HashSet = known[w].values().map(Sent::id).collect(); + | ^^^^ + | +note: existing binding defined here + --> tests/tag_claims.rs:308:12 + | +308 | fn history(seed: u64, steps: usize, count: usize) -> History { + | ^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#similar_names + = note: `-W clippy::similar-names` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::similar_names)]` + +warning: binding's name is too similar to existing binding + --> tests/tag_claims.rs:354:21 + | +354 | let named: Vec = (0..named_count) + | ^^^^^ + | +note: existing binding defined here + --> tests/tag_claims.rs:315:9 + | +315 | let names = ["city", "name", "a"]; + | ^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#similar_names + +warning: binding's name is too similar to existing binding + --> tests/tag_claims.rs:357:21 + | +357 | ... let seen: HashSet = known[w].values().map(Sent::id).collect(); + | ^^^^ + | +note: existing binding defined here + --> tests/tag_claims.rs:308:12 + | +308 | fn history(seed: u64, steps: usize, count: usize) -> History { + | ^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#similar_names + +warning: module has the same name as its containing module + --> src/world_session/tests.rs:2:1 + | + 2 | / mod tests { + 3 | | use tokio::sync::mpsc; + 4 | | + 5 | | use ed25519_dalek::SigningKey; +... | +1842 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#module_inception + +warning: this could be a `const fn` + --> tests/tag_claims.rs:48:5 + | +48 | / fn id(&self) -> Hash { +49 | | self.event.id +50 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn + = note: `-W clippy::missing-const-for-fn` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::missing_const_for_fn)]` +help: make the function `const` + | +48 | const fn id(&self) -> Hash { + | +++++ + +warning: item in documentation is missing backticks + --> tests/tag_claims.rs:281:5 + | +281 | /// SplitMix64. A history is a pure function of its seed. + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown + = note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]` +help: try + | +281 - /// SplitMix64. A history is a pure function of its seed. +281 + /// `SplitMix64`. A history is a pure function of its seed. + | + +warning: this could be a `const fn` + --> tests/tag_claims.rs:285:5 + | +285 | / fn next_u64(&mut self) -> u64 { +286 | | self.0 = self.0.wrapping_add(0x9E37_79B9_7F4A_7C15); +287 | | let mut z = self.0; +288 | | z = (z ^ (z >> 30)).wrapping_mul(0xBF58_476D_1CE4_E5B9); +289 | | z = (z ^ (z >> 27)).wrapping_mul(0x94D0_49BB_1331_11EB); +290 | | z ^ (z >> 31) +291 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +285 | const fn next_u64(&mut self) -> u64 { + | +++++ + +warning: redundant clone + --> tests/tag_claims.rs:477:53 + | +477 | prop_assert_eq!(folded_ids, history.expected.clone()); + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> tests/tag_claims.rs:477:37 + | +477 | prop_assert_eq!(folded_ids, history.expected.clone()); + | ^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + = note: `-W clippy::redundant-clone` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::redundant_clone)]` + +warning: using `.clone()` on a ref-counted pointer + --> src/world_session/tests.rs:1215:66 + | +1215 | ..._hub::WorldOpener> = opener.clone(); + | ^^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&opener)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: `id` (test "tag_claims") generated 8 warnings (run `cargo clippy --fix --test "tag_claims" -p id -- ` to apply 4 suggestions) +warning: this could be a `const fn` + --> tests/membership_scenarios.rs:23:1 + | +23 | / fn key(letter: char) -> AuthId { +24 | | AuthId::Key([letter as u8; 32]) +25 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn + = note: `-W clippy::missing-const-for-fn` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::missing_const_for_fn)]` +help: make the function `const` + | +23 | const fn key(letter: char) -> AuthId { + | +++++ + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:1766:9 + | +1766 | / async fn check_server_key( +1767 | | &mut self, +1768 | | _key: &russh::keys::PublicKeyOrCertificate, +1769 | | ) -> Result { +1770 | | Ok(true) +1771 | | } + | |_________^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +1766 ~ fn check_server_key( +1767 | &mut self, +1768 | _key: &russh::keys::PublicKeyOrCertificate, +1769 ~ ) -> impl Future> { +1770 ~ std::future::ready(Ok(true)) + | + +warning: `id` (test "membership_scenarios") generated 1 warning (run `cargo clippy --fix --test "membership_scenarios" -p id -- ` to apply 1 suggestion) +warning: redundant closure + --> benches/world_bench.rs:68:21 + | +68 | samples.sort_by(|a, b| a.total_cmp(b)); + | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `f64::total_cmp` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_closure_for_method_calls + = note: `-W clippy::redundant-closure-for-method-calls` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_closure_for_method_calls)]` + +warning: this `if` statement can be collapsed + --> src/world_ssh.rs:2353:17 + | +2353 | / ... if let Ok(event) = events.recv().await { +2354 | | ... if matches!(event.kind, crate::world::WorldEventKind::Chat... +2355 | | ... break; +2356 | | ... } +2357 | | ... } + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +2353 ~ if let Ok(event) = events.recv().await +2354 ~ && matches!(event.kind, crate::world::WorldEventKind::Chat { .. }) { +2355 | break; +2356 ~ } + | + +warning: this argument is passed by value, but not consumed in the function body + --> benches/world_bench.rs:72:44 + | +72 | fn report(name: &str, unit: &str, samples: Vec) { + | ^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value + = note: `-W clippy::needless-pass-by-value` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_pass_by_value)]` +help: consider changing the type to + | +72 - fn report(name: &str, unit: &str, samples: Vec) { +72 + fn report(name: &str, unit: &str, samples: &[f64]) { + | +help: change `samples.clone()` to + | +73 - let med = median(samples.clone()); +73 + let med = median(samples.to_owned()); + | + +warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do + --> benches/world_bench.rs:81:30 + | +81 | fn bench_journal_append(dir: &PathBuf, entries: u64, reps: usize) -> Res... + | ^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#ptr_arg + = note: `-W clippy::ptr-arg` implied by `-W clippy::all` + = help: to override `-W clippy::all` add `#[allow(clippy::ptr_arg)]` +help: change this to + | +81 - fn bench_journal_append(dir: &PathBuf, entries: u64, reps: usize) -> Result> { +81 + fn bench_journal_append(dir: &Path, entries: u64, reps: usize) -> Result> { + | + +warning: casting `u64` to `f64` may cause a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) + --> benches/world_bench.rs:92:60 + | +92 | samples.push(start.elapsed().as_secs_f64() * 1e6 / entries as f64); + | ^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_precision_loss + = note: `-W clippy::cast-precision-loss` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_precision_loss)]` + +warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do + --> benches/world_bench.rs:98:26 + | +98 | fn bench_compaction(dir: &PathBuf, entries: u64, reps: usize) -> Result<... + | ^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#ptr_arg +help: change this to + | +98 - fn bench_compaction(dir: &PathBuf, entries: u64, reps: usize) -> Result> { +98 + fn bench_compaction(dir: &Path, entries: u64, reps: usize) -> Result> { + | + +warning: casting `u64` to `f64` may cause a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) + --> benches/world_bench.rs:175:60 + | +175 | samples.push(start.elapsed().as_secs_f64() * 1e6 / events as f64); + | ^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_precision_loss + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> benches/world_bench.rs:211:36 + | +211 | ... let token = tokens[(round as usize) % tokens.len()].clone(); + | ^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation + = note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]` +help: ... or use `try_from` and handle the error accordingly + | +211 - let token = tokens[(round as usize) % tokens.len()].clone(); +211 + let token = tokens[usize::try_from(round) % tokens.len()].clone(); + | + +warning: casting `u64` to `f64` may cause a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) + --> benches/world_bench.rs:219:55 + | +219 | ...ecs_f64() * 1e6 / (rounds * clients as u64) as f64, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_precision_loss + +warning: called `map().unwrap_or_else()` on a `Result` value + --> src/world_ssh.rs:2795:13 + | +2795 | / contract +2796 | | .check_client_frame(&value, phase) +2797 | | .map(str::to_owned) +2798 | | .unwrap_or_else(|error| panic!("{frame}: {error}")) + | |___________________________________________________________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or +help: try + | +2795 ~ contract +2796 + .check_client_frame(&value, phase).map_or_else(|error| panic!("{frame}: {error}"), str::to_owned) + | + +warning: consider adding a `;` to the last statement for consistent formatting + --> src/world_ssh.rs:2966:17 + | +2966 | const { assert!( + | _________________^ +2967 | | MAX_RECORDS_TOTAL_BYTES > MAX_RECORDS_TERMINAL_BYTES, +2968 | | "the total cap must exceed the per-page cap" +2969 | | ) }; + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#semicolon_if_nothing_returned +help: add a `;` here + | +2966 | const { assert!( +2967 | MAX_RECORDS_TOTAL_BYTES > MAX_RECORDS_TERMINAL_BYTES, +2968 | "the total cap must exceed the per-page cap" +2969 ~ ); }; + | + +warning: consider adding a `;` to the last statement for consistent formatting + --> src/world_ssh.rs:2970:17 + | +2970 | const { assert!( + | _________________^ +2971 | | MAX_RECORDS_TOTAL_BYTES < usize::MAX / 4, +2972 | | "the total cap must be finite" +2973 | | ) }; + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#semicolon_if_nothing_returned +help: add a `;` here + | +2970 | const { assert!( +2971 | MAX_RECORDS_TOTAL_BYTES < usize::MAX / 4, +2972 | "the total cap must be finite" +2973 ~ ); }; + | + +warning: `id` (bench "world_bench") generated 8 warnings (run `cargo clippy --fix --bench "world_bench" -p id -- ` to apply 1 suggestion) +warning: redundant clone + --> src/world_store.rs:1073:29 + | +1073 | let mut newer = good.clone(); + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> src/world_store.rs:1073:25 + | +1073 | let mut newer = good.clone(); + | ^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: use of `format!` to build up a string from an iterator + --> src/world_store.rs:1612:28 + | +1612 | ... let text: String = legacy + | __________________________^ +1613 | | ... .iter() +1614 | | ... .map(|entry| format!("{}\n", serde_json::to_string(entry).... +1615 | | ... .collect(); + | |____________________^ + | +help: call `fold` instead + --> src/world_store.rs:1614:14 + | +1614 | ... .map(|entry| format!("{}\n", serde_json::to_string(entry).unwrap... + | ^^^ +help: ... and use the `write!` macro here + --> src/world_store.rs:1614:26 + | +1614 | ...ntry| format!("{}\n", serde_json::to_string(entry).unwrap())) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this can be written more efficiently by appending to a `String` directly + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_collect + +warning: using `.clone()` on a ref-counted pointer + --> src/web/home.rs:294:13 + | +294 | tags.clone(), + | ^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&tags)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: this argument is passed by value, but not consumed in the function body + --> src/web/markdown.rs:4585:42 + | +4585 | fn table_doc_with_cell(cell_content: Value) -> Value { + | ^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +4585 | fn table_doc_with_cell(cell_content: &Value) -> Value { + | + + +warning: called `map().unwrap_or_else()` on an `Option` value + --> src/web/routes.rs:2639:13 + | +2639 | / images +2640 | | .iter() +2641 | | .find(|entry| entry["name"] == name) +2642 | | .map(|entry| entry["hash"].as_str().unwrap().to_owned()) +2643 | | .unwrap_or_else(|| panic!("{name} listed in {images:?}")) + | |_________________________________________________________________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or +help: try + | +2639 ~ images +2640 + .iter() +2641 + .find(|entry| entry["name"] == name).map_or_else(|| panic!("{name} listed in {images:?}"), |entry| entry["hash"].as_str().unwrap().to_owned()) + | + +warning: this argument is passed by value, but not consumed in the function body + --> src/web/routes.rs:3024:27 + | +3024 | fn plain_doc(content: Vec) -> serde_json::Value { + | ^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type to: `&[serde_json::Value]` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value + +warning: you added something to a string. Consider using `String::push_str()` instead + --> src/web/routes.rs:3365:29 + | +3365 | let long_filename = "a".repeat(251) + ".png"; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#string_add + = note: requested on the command line with `-W clippy::string-add` + +warning: using `.clone()` on a ref-counted pointer + --> src/web/world_ws.rs:939:77 + | +939 | ..._hub::WorldOpener> = opener.clone(); + | ^^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&opener)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/web/world_ws.rs:1098:27 + | +1098 | ...k_bytes = ready["chunk_bytes"].as_u64().unwrap() as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +1098 - let chunk_bytes = ready["chunk_bytes"].as_u64().unwrap() as usize; +1098 + let chunk_bytes = usize::try_from(ready["chunk_bytes"].as_u64().unwrap()); + | + +warning: `id` (lib test) generated 364 warnings (260 duplicates) (run `cargo clippy --fix --lib -p id --tests -- ` to apply 36 suggestions) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 19.31s diff --git a/pkgs/id/clippy_out5.txt b/pkgs/id/clippy_out5.txt new file mode 100644 index 0000000000..85e842d2b4 --- /dev/null +++ b/pkgs/id/clippy_out5.txt @@ -0,0 +1,5161 @@ + Checking id v0.1.0 (/app/pkgs/id) +error: empty line after doc comment + --> src/commands/find.rs:212:1 + | +212 | / /// +213 | | + | |_^ +... +223 | pub async fn cmd_find( + | --------------------- the comment documents this function + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#empty_line_after_doc_comments + = note: `-D clippy::empty-line-after-doc-comments` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::empty_line_after_doc_comments)]` + = help: if the empty line is unintentional, remove it +help: if the documentation should include the empty line include it in the comment + | +213 | /// + | + +warning: unused import: `MatchKind` + --> src/commands/repl.rs:98:44 + | +98 | CLIENT_KEY_FILE, FindMatch, META_ALPN, MatchKind, MetaRequest, MetaR... + | ^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unnecessary qualification + --> src/commands/world.rs:1088:33 + | +1088 | let mut paths: Vec<(String, std::path::PathBuf)> = Vec::new(); + | ^^^^^^^^^^^^^^^^^^ + | + = note: requested on the command line with `-W unused-qualifications` +help: remove the unnecessary path segments + | +1088 - let mut paths: Vec<(String, std::path::PathBuf)> = Vec::new(); +1088 + let mut paths: Vec<(String, PathBuf)> = Vec::new(); + | + +warning: unnecessary qualification + --> src/commands/world.rs:1091:31 + | +1091 | ... let mut siblings: Vec = std::fs::read_dir(so... + | ^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1091 - let mut siblings: Vec = std::fs::read_dir(source) +1091 + let mut siblings: Vec = std::fs::read_dir(source) + | + +warning: unnecessary qualification + --> src/world_doctor.rs:202:9 + | +202 | std::path::Path::new(roc_bin).is_file() + | ^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +202 - std::path::Path::new(roc_bin).is_file() +202 + Path::new(roc_bin).is_file() + | + +warning: you matched a field with a wildcard pattern, consider using `..` instead + --> src/world_doctor.rs:374:17 + | +374 | world_id: _, + | ^^^^^^^^^^^ + | + = help: try with `Created { version: created_version, .. }` + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unneeded_field_pattern + = note: requested on the command line with `-W clippy::unneeded-field-pattern` + +warning: unused import: `CompileFile` + --> src/world_session/mod.rs:54:39 + | +54 | CAPS_CEILING_NOTICE, ClientFrame, CompileFile, MAX_ADMIN_TOKEN_BYTES... + | ^^^^^^^^^^^ + +warning: unnecessary qualification + --> src/world_session/mod.rs:691:19 + | +691 | let hash: iroh_blobs::Hash = expected_hash + | ^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +691 - let hash: iroh_blobs::Hash = expected_hash +691 + let hash: Hash = expected_hash + | + +warning: unused import: `JOURNAL_VERSION_EXECUTION_PROFILE` + --> src/world_store.rs:31:22 + | +31 | JOURNAL_VERSION, JOURNAL_VERSION_EXECUTION_PROFILE, JournalEntry, Wo... + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: empty line after doc comment + --> src/web/markdown.rs:2394:1 + | +2394 | / /// shared-mark case; non-chain children keep the original merge. +2395 | | + | |_^ +... +2415 | fn adopt_trailing_html_atoms<'a>(parent: &'a AstNode<'a>, wrappers: ... + | ---------------------------- the comment documents this function + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#empty_line_after_doc_comments + = help: if the empty line is unintentional, remove it +help: if the documentation should include the empty line include it in the comment + | +2395 | /// + | + +warning: long literal lacking separators + --> src/cli.rs:4336:48 + | +4336 | assert_eq!(wasm_fuel, Some(500000)); + | ^^^^^^ help: consider: `500_000` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unreadable_literal + = note: `-W clippy::unreadable-literal` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::unreadable_literal)]` + +warning: long literal lacking separators + --> src/cli.rs:4337:56 + | +4337 | assert_eq!(wasm_memory_bytes, Some(16777216)); + | ^^^^^^^^ help: consider: `16_777_216` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unreadable_literal + +warning: binding's name is too similar to existing binding + --> src/event_store/sync.rs:788:14 + | +788 | ... let (dialed, accepted) = tokio::time::timeout(Duration::from_secs... + | ^^^^^^ + | +note: existing binding defined here + --> src/event_store/sync.rs:762:9 + | +762 | dialer: SecretKey, + | ^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#similar_names + = note: `-W clippy::similar-names` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::similar_names)]` + +warning: unnecessary qualification + --> src/log_sync.rs:841:15 + | +841 | ... match tokio::time::timeout(std::time::Duration::from_secs(10), re... + | ^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +841 - match tokio::time::timeout(std::time::Duration::from_secs(10), results.recv()).await { +841 + match timeout(std::time::Duration::from_secs(10), results.recv()).await { + | + +warning: unnecessary qualification + --> src/log_sync.rs:841:36 + | +841 | ... match tokio::time::timeout(std::time::Duration::from_secs(10), re... + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +841 - match tokio::time::timeout(std::time::Duration::from_secs(10), results.recv()).await { +841 + match tokio::time::timeout(Duration::from_secs(10), results.recv()).await { + | + +warning: binding's name is too similar to existing binding + --> src/meta_client.rs:232:13 + | +232 | let served = serve_once(server.clone(), payload); + | ^^^^^^ + | +note: existing binding defined here + --> src/meta_client.rs:230:13 + | +230 | let server = endpoint(vec![TEST_ALPN.to_vec()]).await.unwrap(); + | ^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#similar_names + +warning: `mod.rs` files are required, found `src/shell_contract.rs` + --> src/shell_contract.rs:1:1 + | +1 | //! The versioned shell contract (F13.1). + | ^ + | + = help: move `src/shell_contract.rs` to `src/shell_contract/mod.rs` + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#self_named_module_files + = note: requested on the command line with `-W clippy::self-named-module-files` + +warning: unused import: `crate::world::*` + --> src/world/tests.rs:2505:9 + | +2505 | use crate::world::*; + | ^^^^^^^^^^^^^^^ + +warning: unused import: `crate::world::*` + --> src/world/tests.rs:2775:9 + | +2775 | use crate::world::*; + | ^^^^^^^^^^^^^^^ + +warning: unused import: `crate::world::*` + --> src/world/tests.rs:3137:9 + | +3137 | use crate::world::*; + | ^^^^^^^^^^^^^^^ + +warning: unnecessary qualification + --> src/world_compile.rs:1319:9 + | +1319 | crate::world_compile::locate_roc() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1319 - crate::world_compile::locate_roc() +1319 + locate_roc() + | + +warning: unnecessary hashes around raw string literal + --> src/world_fixture.rs:1074:39 + | +1074 | let second = vec![snapshot(2, r#"{}"#)]; + | ^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_raw_string_hashes + = note: `-W clippy::needless-raw-string-hashes` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_raw_string_hashes)]` +help: remove all the hashes around the string literal + | +1074 - let second = vec![snapshot(2, r#"{}"#)]; +1074 + let second = vec![snapshot(2, r"{}")]; + | + +warning: unused import: `super::*` + --> src/world_session/tests.rs:7:9 + | +7 | use super::*; + | ^^^^^^^^ + +warning: unnecessary qualification + --> src/world_ssh.rs:2682:18 + | +2682 | Some(russh::ChannelMsg::Failure) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2682 - Some(russh::ChannelMsg::Failure) +2682 + Some(ChannelMsg::Failure) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2688:18 + | +2688 | Some(russh::ChannelMsg::Success) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2688 - Some(russh::ChannelMsg::Success) +2688 + Some(ChannelMsg::Success) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2694:18 + | +2694 | Some(russh::ChannelMsg::Failure) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2694 - Some(russh::ChannelMsg::Failure) +2694 + Some(ChannelMsg::Failure) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2705:26 + | +2705 | ... Some(russh::ChannelMsg::Eof | russh::ChannelMsg::Close) | None =... + | ^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2705 - Some(russh::ChannelMsg::Eof | russh::ChannelMsg::Close) | None => break, +2705 + Some(ChannelMsg::Eof | russh::ChannelMsg::Close) | None => break, + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2705:51 + | +2705 | ... Some(russh::ChannelMsg::Eof | russh::ChannelMsg::Close) | None =... + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2705 - Some(russh::ChannelMsg::Eof | russh::ChannelMsg::Close) | None => break, +2705 + Some(russh::ChannelMsg::Eof | ChannelMsg::Close) | None => break, + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2754:18 + | +2754 | Some(russh::ChannelMsg::Success) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2754 - Some(russh::ChannelMsg::Success) +2754 + Some(ChannelMsg::Success) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2762:17 + | +2762 | crate::frames::encode_frame(join.as_bytes()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2762 - crate::frames::encode_frame(join.as_bytes()) +2762 + encode_frame(join.as_bytes()) + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2768:26 + | +2768 | let mut buffer = crate::frames::FrameBuffer::default(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2768 - let mut buffer = crate::frames::FrameBuffer::default(); +2768 + let mut buffer = FrameBuffer::default(); + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2772:26 + | +2772 | Some(russh::ChannelMsg::Data { data }) => { + | ^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2772 - Some(russh::ChannelMsg::Data { data }) => { +2772 + Some(ChannelMsg::Data { data }) => { + | + +warning: unnecessary qualification + --> src/world_ssh.rs:2774:37 + | +2774 | ... if let Some(crate::frames::Decoded::Frame(body)) = buffer.next_f... + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2774 - if let Some(crate::frames::Decoded::Frame(body)) = buffer.next_frame() { +2774 + if let Some(Decoded::Frame(body)) = buffer.next_frame() { + | + +warning: unnecessary qualification + --> src/world_store.rs:1442:23 + | +1442 | kind: crate::world::WorldEventKind::ProgramInstalled { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1442 - kind: crate::world::WorldEventKind::ProgramInstalled { +1442 + kind: WorldEventKind::ProgramInstalled { + | + +warning: unnecessary qualification + --> src/world_store.rs:1510:17 + | +1510 | crate::world::Authority::Admin, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1510 - crate::world::Authority::Admin, +1510 + Authority::Admin, + | + +warning: unnecessary qualification + --> src/world_store.rs:1511:17 + | +1511 | crate::world::Isolation::Unisolated, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +1511 - crate::world::Isolation::Unisolated, +1511 + Isolation::Unisolated, + | + +warning: unnecessary qualification + --> src/web/routes.rs:2468:66 + | +2468 | ... &str) -> (StatusCode, axum::http::HeaderMap, Vec) { + | ^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2468 - async fn get_blob(router: Router, uri: &str) -> (StatusCode, axum::http::HeaderMap, Vec) { +2468 + async fn get_blob(router: Router, uri: &str) -> (StatusCode, HeaderMap, Vec) { + | + +warning: unnecessary qualification + --> src/web/routes.rs:2485:36 + | +2485 | fn header_str<'a>(headers: &'a axum::http::HeaderMap, name: &str) ... + | ^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the unnecessary path segments + | +2485 - fn header_str<'a>(headers: &'a axum::http::HeaderMap, name: &str) -> Option<&'a str> { +2485 + fn header_str<'a>(headers: &'a HeaderMap, name: &str) -> Option<&'a str> { + | + +warning: binding's name is too similar to existing binding + --> src/web/world_ws.rs:1203:13 + | +1203 | let compiled = next_frame(&mut uploader).await.unwrap(); + | ^^^^^^^^ + | +note: existing binding defined here + --> src/web/world_ws.rs:1169:13 + | +1169 | ... let compiler = crate::world_compile::Compiler::new(platform_dir,... + | ^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#similar_names + +warning: method `keeps` is never used + --> src/event_store/ingest.rs:468:8 + | +466 | impl Staged { + | ----------- method in this implementation +467 | /// Whether the event ... +468 | fn keeps(&self) -> bool { + | ^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: function `collect_list_items` is never used + --> src/web/markdown.rs:824:4 + | +824 | fn collect_list_items<'a>(node: &'a AstNode<'a>) -> Vec { + | ^^^^^^^^^^^^^^^^^^ + +warning: first doc comment paragraph is too long + --> src/aliases.rs:114:1 + | +114 | / /// The rows of a view over `named`, with the rules above. `primary_a... +115 | | /// server's stored primary alias for them, if this server keeps one.... +116 | | /// to the owner's pet name for it. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + = note: `-W clippy::too-long-first-doc-paragraph` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::too_long_first_doc_paragraph)]` + +warning: these match arms have identical bodies + --> src/chain.rs:240:13 + | +240 | (false, None) => {} + | ^^^^^^^^^^^^^^^^^^^ +... +253 | (true, Some(_)) => {} + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms + = note: `-W clippy::match-same-arms` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::match_same_arms)]` +help: otherwise merge the patterns into a single arm + | +240 ~ (false, Some(_)) => { +241 | return Err(ChainError::Extension(format!( +... +251 | } +252 ~ (false, None) | (true, Some(_)) => {} + | + +error: large size difference between variants + --> src/cli.rs:200:1 + | + 200 | / pub enum Command { + 201 | | /// Start a server that accepts put/get requests from peers. + 202 | | /// + 203 | | /// The server runs indefinitely, hosting stored blobs and acc... +... | + 243 | | / Serve { + 244 | | | /// Use in-memory storage instead of persistent disk storage. + 245 | | | /// + 246 | | | /// Content is lost when the server stops. Useful for testing +... | | + 470 | | | open_writes: bool, + 471 | | | }, + | | |_____- the largest variant contains at least 543 bytes +... | + 867 | | / Find { + 868 | | | /// Search queries (case-insensitive). + 869 | | | /// + 870 | | | /// Multiple queries find the best match for each. +... | | + 909 | | | no_relay: bool, + 910 | | | }, + | | |_____- the second-largest variant contains at least 157 bytes +... | +1247 | | }, +1248 | | } + | |___^ the entire enum is at least 544 bytes + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#large_enum_variant + = note: `-D clippy::large-enum-variant` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::large_enum_variant)]` +help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum + | + 381 ~ world_mail_smtp: Box>, + 382 | /// Sender address for mail sent with `--world-mail-smtp`. + ... + 434 | #[command(flatten)] + 435 ~ world_runtime: Box, + 436 | /// Capability the default world's program may use (repeatable; `*` + ... + 443 | #[arg(long, default_value = "deny", requires = "world")] + 444 ~ world_cap_policy: Box, + 445 | /// Capabilities the server allows any world to use, comma-separated + ... + 448 | #[arg(long, value_name = "NAMES", value_delimiter = ',', requires = "world")] + 449 ~ world_allowed_caps: Box>>, + 450 | /// The Roc binary used to compile sources sent to `id world compile` + 451 | /// (default: $`ID_ROC_BIN` or `roc` from PATH). + 452 | #[arg(long, env = "ID_ROC_BIN")] + 453 ~ roc_bin: Box>, + 454 | /// The world platform directory used for on-the-fly compilation + 455 | /// (default: $`ID_ROC_PLATFORM` or ./examples/roc-world). + 456 | #[arg(long, env = "ID_ROC_PLATFORM")] + 457 ~ roc_platform: Box>, + 458 | /// Allow this node to modify the store (repeatable, comma-separated). + ... + 464 | #[arg(long = "allow-node", value_delimiter = ',')] + 465 ~ allow_node: Box>, + | + +warning: item in documentation is missing backticks + --> src/cli.rs:321:62 + | +321 | ...er does not use the mainline BitTorrent DHT + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown + = note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]` +help: try + | +321 - /// By default, the server does not use the mainline BitTorrent DHT +321 + /// By default, the server does not use the mainline `BitTorrent` DHT + | + +warning: item in documentation is missing backticks + --> src/cli.rs:1545:63 + | +1545 | ...it, the key must be in ~/.ssh/known_hosts. + | ^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1545 - /// (`SHA256:...`). Without it, the key must be in ~/.ssh/known_hosts. +1545 + /// (`SHA256:...`). Without it, the key must be in ~/.`ssh/known_hosts`. + | + +warning: item in documentation is missing backticks + --> src/cli.rs:1561:9 + | +1561 | /// ProxyCommand instead of listening. + | ^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1561 - /// ProxyCommand instead of listening. +1561 + /// `ProxyCommand` instead of listening. + | + +warning: variables can be used directly in the `format!` string + --> src/commands/find.rs:165:9 + | +165 | / ... bail!( +166 | | ... "refusing download of match with unsafe name {:?}: no final... +167 | | ... name +168 | | ... ); + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args + = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]` + +warning: variables can be used directly in the `format!` string + --> src/commands/find.rs:174:9 + | +174 | / ... bail!( +175 | | ... "refusing download of match with unsafe name {:?}: no final... +176 | | ... name +177 | | ... ); + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args + +warning: variables can be used directly in the `format!` string + --> src/commands/find.rs:180:22 + | +180 | Some(dir) => format!("{}/{}", dir, file_name), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args +help: change this to + | +180 - Some(dir) => format!("{}/{}", dir, file_name), +180 + Some(dir) => format!("{dir}/{file_name}"), + | + +error: this function has too many arguments (9/7) + --> src/commands/find.rs:223:1 + | +223 | / pub async fn cmd_find( +224 | | queries: Vec, +225 | | prefer_name: bool, +226 | | to_stdout: bool, +... | +232 | | no_relay: bool, +233 | | ) -> Result<()> { + | |_______________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_many_arguments + = note: `-D clippy::too-many-arguments` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::too_many_arguments)]` + +warning: all if blocks contain the same code at the end + --> src/commands/find.rs:317:5 + | +317 | / let m = &all_matches[0]; +318 | | let output = if to_stdout { +319 | | "-".to_owned() +320 | | } else { +... | +329 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#branches_sharing_code + = note: `-W clippy::branches-sharing-code` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::branches_sharing_code)]` +help: consider moving these statements after the if + | +317 ~ } +318 + let m = &all_matches[0]; +319 + let output = if to_stdout { +320 + "-".to_owned() +321 + } else { +322 + download_output_path(None, &m.name)? +323 + }; +324 + if let Some(node_str) = node { +325 + let node_id: EndpointId = node_str.parse()?; +326 + cmd_get_one_remote(node_id, &m.name, &output, no_relay).await?; +327 + } else { +328 + cmd_get_one(&m.name, &output, false, false).await?; +329 + } + | + +error: this function has too many arguments (8/7) + --> src/commands/find.rs:364:1 + | +364 | / pub async fn cmd_search( +365 | | queries: Vec, +366 | | prefer_name: bool, +367 | | all: bool, +... | +372 | | no_relay: bool, +373 | | ) -> Result<()> { + | |_______________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_many_arguments + +error: this function has too many arguments (8/7) + --> src/commands/find.rs:580:1 + | +580 | / pub async fn cmd_peek( +581 | | queries: Vec, +582 | | prefer_name: bool, +583 | | all: bool, +... | +588 | | no_relay: bool, +589 | | ) -> Result<()> { + | |_______________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_many_arguments + +warning: called `map().unwrap_or()` on a `Result` value + --> src/commands/group.rs:186:15 + | +186 | let now = std::time::SystemTime::now() + | _______________^ +187 | | .duration_since(std::time::UNIX_EPOCH) +188 | | .map(|d| d.as_secs()) +189 | | .unwrap_or(0); + | |_____________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or + = note: `-W clippy::map-unwrap-or` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::map_unwrap_or)]` +help: use `map_or(, )` instead + | +188 - .map(|d| d.as_secs()) +189 - .unwrap_or(0); +188 + .map_or(0, |d| d.as_secs()); + | + +error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator + --> src/commands/group.rs:192:24 + | +192 | let size_warning = warnings + | ________________________^ +193 | | .iter() +194 | | .filter(|w| matches!(w, Warning::Size { .. })) +195 | | .last(); + | |_______________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#double_ended_iterator_last + = note: `-D clippy::double-ended-iterator-last` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::double_ended_iterator_last)]` +help: try + | +195 - .last(); +195 + .next_back(); + | + +warning: these match arms have identical bodies + --> src/commands/repl.rs:1118:13 + | +1118 | / ReplContextInner::Remote { +1119 | | endpoint, +1120 | | meta_conn, +1121 | | blobs_conn, +... | +1132 | | store.shutdown().await?; +1133 | | } + | |_____________^ +1134 | / ReplContextInner::RemoteNode { +1135 | | endpoint, +1136 | | meta_conn, +1137 | | blobs_conn, +... | +1148 | | store.shutdown().await?; +1149 | | } + | |_____________^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +1118 ~ ReplContextInner::Remote { +1119 + endpoint, +1120 + meta_conn, +1121 + blobs_conn, +1122 + store, +1123 + .. +1124 ~ } | ReplContextInner::RemoteNode { + | + +warning: used underscore-prefixed binding + --> src/commands/serve.rs:1312:30 + | +1312 | if let Some(sync_task) = _event_sync_handle { + | ^^^^^^^^^^^^^^^^^^ + | +note: binding is defined here + --> src/commands/serve.rs:999:9 + | + 999 | let _event_sync_handle = event_events.clone().map(|events| { + | ^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#used_underscore_binding + = note: `-W clippy::used-underscore-binding` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::used_underscore_binding)]` + +warning: used underscore-prefixed binding + --> src/commands/serve.rs:1317:29 + | +1317 | if let Some(web_task) = _web_handle { + | ^^^^^^^^^^^ + | +note: binding is defined here + --> src/commands/serve.rs:1203:9 + | +1203 | let _web_handle = if let Some(listener) = web_listener { + | ^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#used_underscore_binding + +warning: called `map().unwrap_or()` on a `Result` value + --> src/commands/serve.rs:1456:5 + | +1456 | / std::time::SystemTime::now() +1457 | | .duration_since(std::time::UNIX_EPOCH) +1458 | | .map(|duration| duration.as_secs()) +1459 | | .unwrap_or(0) + | |_____________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or +help: use `map_or(, )` instead + | +1458 - .map(|duration| duration.as_secs()) +1459 - .unwrap_or(0) +1458 + .map_or(0, |duration| duration.as_secs()) + | + +warning: unnecessary boolean `not` operation + --> src/commands/world.rs:498:17 + | +498 | / ... if !dry_run { +499 | | ... let applied = apply_steps(&client, &admin_token, &capabilit... +500 | | ... if applied == steps.len() { +501 | | ... println!("applied {} step(s)", applied); +... | +510 | | ... println!("dry run: nothing changed"); +511 | | ... } + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#if_not_else + = note: `-W clippy::if-not-else` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::if_not_else)]` +help: try + | +498 ~ if dry_run { +499 + println!("dry run: nothing changed"); +500 + } else { +501 + let applied = apply_steps(&client, &admin_token, &capability, &steps).await?; +502 + if applied == steps.len() { +503 + println!("applied {} step(s)", applied); +504 + } else { +505 + println!( +506 + "applied {} of {} step(s); the rest were reported but not applied", +507 + applied, +508 + steps.len() +509 + ); +510 + } +511 + } + | + +warning: variables can be used directly in the `format!` string + --> src/commands/world.rs:501:25 + | +501 | println!("applied {} step(s)", applied); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args +help: change this to + | +501 - println!("applied {} step(s)", applied); +501 + println!("applied {applied} step(s)"); + | + +warning: these match arms have identical bodies + --> src/commands/world.rs:570:21 + | +570 | Err(_) => break Ok(()), + | ^^^^^^^^^^^^^^^^^^^^^^ +571 | Ok(Err(error)) => break Err(error), +572 | Ok(Ok(None)) => break Ok(()), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +570 ~ Ok(Err(error)) => break Err(error), +571 ~ Err(_) | Ok(Ok(None)) => break Ok(()), + | + +warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` + --> src/commands/world.rs:764:17 + | +764 | let check = match ssh_host_key { + | _________________^ +765 | | Some(fingerprint) => HostKeyCheck::Fingerprint(fingerprint), +766 | | None => { +767 | | let home = std::env::var_os("HOME") +... | +771 | | }; + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_match_else + = note: `-W clippy::single-match-else` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::single_match_else)]` +help: try + | +764 ~ let check = if let Some(fingerprint) = ssh_host_key { HostKeyCheck::Fingerprint(fingerprint) } else { +765 + let home = std::env::var_os("HOME") +766 + .context("no HOME for ~/.ssh/known_hosts; pass --ssh-host-key")?; +767 + HostKeyCheck::KnownHosts(PathBuf::from(home).join(".ssh").join("known_hosts")) +768 ~ }; + | + +warning: item in documentation is missing backticks + --> src/commands/world.rs:778:5 + | +778 | /// ProxyCommand) over iroh to the host's world SSH server (F13.3). The + | ^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +778 - /// ProxyCommand) over iroh to the host's world SSH server (F13.3). The +778 + /// `ProxyCommand`) over iroh to the host's world SSH server (F13.3). The + | + +warning: this could be a `const fn` + --> src/commands/world.rs:928:1 + | +928 | / fn step_is_applied(step: &crate::world_manifest::ApplyStep) -> bool { +929 | | use crate::world_manifest::ApplyStep; +930 | | matches!( +931 | | step, +... | +939 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn + = note: `-W clippy::missing-const-for-fn` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::missing_const_for_fn)]` +help: make the function `const` + | +928 | const fn step_is_applied(step: &crate::world_manifest::ApplyStep) -> bool { + | +++++ + +error: the following explicit lifetimes could be elided: 'a + --> src/commands/world.rs:966:18 + | +966 | fn ordered_steps<'a>( + | ^^ +967 | steps: &'a [crate::world_manifest::ApplyStep], + | ^^ +968 | ) -> Vec<&'a crate::world_manifest::ApplyStep> { + | ^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_lifetimes + = note: `-D clippy::needless-lifetimes` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::needless_lifetimes)]` +help: elide the lifetimes + | +966 ~ fn ordered_steps( +967 ~ steps: &[crate::world_manifest::ApplyStep], +968 ~ ) -> Vec<&crate::world_manifest::ApplyStep> { + | + +warning: this could be a `const fn` + --> src/commands/world.rs:970:5 + | +970 | / fn rank(step: &ApplyStep) -> u8 { +971 | | match step { +972 | | ApplyStep::CancelSchedule { .. } => 0, +973 | | ApplyStep::SetProfile { .. } => 1, +... | +979 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +970 | const fn rank(step: &ApplyStep) -> u8 { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/ingest.rs:468:5 + | +468 | / fn keeps(&self) -> bool { +469 | | matches!( +470 | | self, +471 | | Self::Stored { .. } +... | +479 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +468 | const fn keeps(&self) -> bool { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/range.rs:100:5 + | +100 | / pub fn new(k: usize, t: usize) -> Result { +101 | | if k < 2 { +102 | | return Err(ParamsError::FanOut(k)); +... | +112 | | }) +113 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +100 | pub const fn new(k: usize, t: usize) -> Result { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/range.rs:136:5 + | +136 | / pub fn with_session_budget(self, bytes: usize) -> Result Result { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/range.rs:253:5 + | +253 | / pub fn len(&self) -> usize { +254 | | self.keys.len() +255 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +253 | pub const fn len(&self) -> usize { + | +++++ + +warning: this could be a `const fn` + --> src/event_store/range.rs:258:5 + | +258 | / pub fn is_empty(&self) -> bool { +259 | | self.keys.is_empty() +260 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +258 | pub const fn is_empty(&self) -> bool { + | +++++ + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> src/event_store/range.rs:277:15 + | +277 | (out, (hi - lo) as u32) + | ^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation + = note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]` +help: ... or use `try_from` and handle the error accordingly + | +277 - (out, (hi - lo) as u32) +277 + (out, u32::try_from(hi - lo)) + | + +warning: this argument is passed by value, but not consumed in the function body + --> src/event_store/range.rs:361:16 + | +361 | upper: Option>, + | ^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value + = note: `-W clippy::needless-pass-by-value` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_pass_by_value)]` +help: consider taking a reference instead + | +361 | upper: Option<&Vec>, + | + + +error: this `if` statement can be collapsed + --> src/event_store/range.rs:391:5 + | +391 | / if mode == Mode::Skip { +392 | | if let Some(last) = out.last_mut() { +393 | | if last.mode == Mode::Skip { +394 | | last.upper = upper; +... | +398 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if + = note: `-D clippy::collapsible-if` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::collapsible_if)]` +help: collapse nested if block + | +391 ~ if mode == Mode::Skip +392 ~ && let Some(last) = out.last_mut() { +393 | if last.mode == Mode::Skip { +... +396 | } +397 ~ } + | + +error: this `if` statement can be collapsed + --> src/event_store/range.rs:392:9 + | +392 | / if let Some(last) = out.last_mut() { +393 | | if last.mode == Mode::Skip { +394 | | last.upper = upper; +395 | | return; +396 | | } +397 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +392 ~ if let Some(last) = out.last_mut() +393 ~ && last.mode == Mode::Skip { +394 | last.upper = upper; +395 | return; +396 ~ } + | + +warning: casting `usize` to `u8` may truncate the value + --> src/event_store/range.rs:404:19 + | +404 | out.push((x as u8 & 0x7f) | 0x80); + | ^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +404 - out.push((x as u8 & 0x7f) | 0x80); +404 + out.push((u8::try_from(x) & 0x7f) | 0x80); + | + +warning: casting `usize` to `u8` may truncate the value + --> src/event_store/range.rs:407:14 + | +407 | out.push(x as u8); + | ^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +407 - out.push(x as u8); +407 + out.push(u8::try_from(x)); + | + +warning: casting `usize` to `u8` may truncate the value + --> src/event_store/range.rs:415:22 + | +415 | out.push(b.len() as u8); + | ^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +415 - out.push(b.len() as u8); +415 + out.push(u8::try_from(b.len())); + | + +warning: first doc comment paragraph is too long + --> src/event_store/range.rs:611:1 + | +611 | / /// Runs the protocol between two in-memory sets, through the same fr... +612 | | /// each side's own parameters. `a` opens. Used to check convergence ... +613 | | /// difference without a transport. +614 | | /// +615 | | /// # Errors + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: this could be a `const fn` + --> src/event_store/sync.rs:118:5 + | +118 | / fn add(&mut self, outcome: &Ingest) { +119 | | match outcome { +120 | | Ingest::Accepted { .. } => self.accepted += 1, +121 | | Ingest::Duplicate { .. } => self.duplicates += 1, +... | +127 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +118 | const fn add(&mut self, outcome: &Ingest) { + | +++++ + +warning: item in documentation is missing backticks + --> src/event_store/sync.rs:186:70 + | +186 | ... stream to the last event, as LogSync's does. + | ^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +186 - /// the whole session, from opening the stream to the last event, as LogSync's does. +186 + /// the whole session, from opening the stream to the last event, as `LogSync`'s does. + | + +warning: first doc comment paragraph is too long + --> src/event_store/sync.rs:184:1 + | +184 | / /// Runs one range session over an open connection. The dialer opens ... +185 | | /// `initiator = true`. `now_ms` is the clock the store's waiting rul... +186 | | /// the whole session, from opening the stream to the last event, as ... +187 | | /// +188 | | /// # Errors + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: this could be a `const fn` + --> src/event_store/sync.rs:353:5 + | +353 | / fn charge(&mut self, cost: usize) -> Result<(), BudgetExceeded> { +354 | | let total = self.read.saturating_add(cost); +355 | | if total > self.budget { +356 | | return Err(BudgetExceeded { +... | +362 | | Ok(()) +363 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +353 | const fn charge(&mut self, cost: usize) -> Result<(), BudgetExceeded> { + | +++++ + +error: this function has too many arguments (8/7) + --> src/event_store/sync.rs:423:1 + | +423 | / async fn run( +424 | | store: &mut EventStore, +425 | | conn: &Connection, +426 | | initiator: bool, +... | +431 | | commits: Option, +432 | | ) -> Result { + | |____________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_many_arguments + +error: this `if` statement can be collapsed + --> src/event_store/sync.rs:520:13 + | +520 | / if let Some((records, wait)) = &cut_records { +521 | | if sent == *records { +522 | | if let Some((signal, committed)) = wait { +523 | | wait_for_commit(signal, *committed).await; +... | +528 | | } + | |_____________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +520 ~ if let Some((records, wait)) = &cut_records +521 ~ && sent == *records { +522 | if let Some((signal, committed)) = wait { +... +526 | bail!("cut before event {}", sent + 1); +527 ~ } + | + +warning: it is more idiomatic to use `Option<&T>` instead of `&Option` + --> src/event_store/sync.rs:574:1 + | +574 | / async fn receive_data( +575 | | recv: &mut RecvStream, +576 | | store: &Mutex<&mut EventStore>, +577 | | need: &mut HashSet, +... | +607 | | Ok((count, tally)) +608 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#ref_option + = note: `-W clippy::ref-option` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::ref_option)]` +help: change this to + | +579 - commits: &Option, +579 + commits: Option<&CommitSignal>, + | + +warning: it is more idiomatic to use `Option<&T>` instead of `&Option` + --> src/event_store/sync.rs:610:1 + | +610 | / fn flush( +611 | | store: &Mutex<&mut EventStore>, +612 | | pending: &mut Vec, +613 | | now_ms: u64, +... | +629 | | Ok(()) +630 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#ref_option +help: change this to + | +615 - commits: &Option, +615 + commits: Option<&CommitSignal>, + | + +error: using `chunks_exact` with a constant chunk size + --> src/event_store/waiting_rows.rs:84:14 + | +84 | .chunks_exact(32) + | ^^^^^^^^^^^^^^^^ help: consider using `as_chunks` instead: `as_chunks::<32>().0.iter()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#chunks_exact_to_as_chunks + = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::chunks_exact_to_as_chunks)]` + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/event_store/mod.rs:557:13 + | +557 | / struct StoredMeta { +558 | | author: AuthorKey, +559 | | seq: SeqNum, +560 | | parents: Vec, +... | +563 | | position: [u8; POSITION_LEN], +564 | | } + | |_____________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + = note: `-W clippy::items-after-statements` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::items_after_statements)]` + +warning: item in documentation is missing backticks + --> src/event_sync.rs:11:15 + | +11 | //! publishes ProseMirror save revisions into. `serve` opens that store ... + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +11 - //! publishes ProseMirror save revisions into. `serve` opens that store once and shares +11 + //! publishes `ProseMirror` save revisions into. `serve` opens that store once and shares + | + +warning: first doc comment paragraph is too long + --> src/event_sync.rs:72:1 + | +72 | / /// Serves range-sync sessions over the node's shared [`LocalEvents`] ... +73 | | /// Register it with `Router::builder(..).accept(ALPN, EventSyncProtoc... +74 | | /// where `events` is the same instance the web layer publishes into. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph +help: add an empty line + | +72 | /// Serves range-sync sessions over the node's shared [`LocalEvents`] store. +73 + /// + | + +warning: first doc comment paragraph is too long + --> src/groups/worlds.rs:1:1 + | +1 | / //! Cross-world authority (P2.7, task 03 item 7): each world judges its... +2 | | //! membership and delegations, and a grant that names another world is... +3 | | //! authority reaches into another. +4 | | //! +5 | | //! The design (§7.5 and the two cross-world docs) says the rules "over... + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: this could be rewritten as `let...else` + --> src/groups/delegation.rs:97:9 + | + 97 | / let (author, author_role) = match self.effective_author(by_id... + 98 | | Some(res) => res, + 99 | | None => return Ok(Err(Refusal::NotActive)), +100 | | }; + | |__________^ help: consider writing: `let Some((author, author_role)) = self.effective_author(by_id, group, event) else { return Ok(Err(Refusal::NotActive)) };` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_let_else + = note: `-W clippy::manual-let-else` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_let_else)]` + +warning: this could be rewritten as `let...else` + --> src/groups/delegation.rs:141:9 + | +141 | / let (author, author_role) = match self.effective_author(by_id... +142 | | Some(res) => res, +143 | | None => return Ok(Err(Refusal::NotActive)), +144 | | }; + | |__________^ help: consider writing: `let Some((author, author_role)) = self.effective_author(by_id, group, event) else { return Ok(Err(Refusal::NotActive)) };` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_let_else + +error: using `chunks_exact` with a constant chunk size + --> src/invites/invitation.rs:121:50 + | +121 | for (slot, pair) in out.iter_mut().zip(bytes.chunks_exact(2)) { + | ^^^^^^^^^^^^^^^ + | +help: consider using `as_chunks::<2>()` instead + --> src/invites/invitation.rs:121:50 + | +121 | for (slot, pair) in out.iter_mut().zip(bytes.chunks_exact(2)) { + | ^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#chunks_exact_to_as_chunks + +error: this `if` statement can be collapsed + --> src/local_events.rs:311:17 + | +311 | / if seen.insert(claim.author) { +312 | | if let Some(head) = heads.get(&claim.author) { +313 | | required.push(*head); +314 | | } +315 | | } + | |_________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +311 ~ if seen.insert(claim.author) +312 ~ && let Some(head) = heads.get(&claim.author) { +313 | required.push(*head); +314 ~ } + | + +warning: unused import: `std::io::Write` + --> src/directory_mail.rs:257:9 + | +257 | use std::io::Write as _; + | ^^^^^^^^^^^^^^ + +warning: wildcard matches only a single variant and will also match any future added variants + --> src/meta_client.rs:59:9 + | +59 | other => other.into(), + | ^^^^^ help: try: `other @ ReadToEndError::Read(_)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_wildcard_for_single_variants + = note: `-W clippy::match-wildcard-for-single-variants` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::match_wildcard_for_single_variants)]` + +warning: these match arms have identical bodies + --> src/repl/runner.rs:389:9 + | +389 | / (None, ["tags" | "labels" | "links"]) => { +390 | | ctx.get_tags(None).await?; +391 | | Ok(ReplAction::Continue) +392 | | } + | |_________^ +... +406 | / (None, ["tag" | "label" | "link", "list" | "ls"]) => { +407 | | ctx.get_tags(None).await?; +408 | | Ok(ReplAction::Continue) +409 | | } + | |_________^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +389 ~ (None, ["tags" | "labels" | "links"]) | (None, ["tag" | "label" | "link", "list" | "ls"]) => { +390 | ctx.get_tags(None).await?; +... +405 | } +406 ~ (None, ["tag" | "label" | "link", "list" | "ls", subject]) => { + | + +warning: these match arms have identical bodies + --> src/repl/runner.rs:393:9 + | +393 | / (None, ["tags" | "labels" | "links", subject]) => { +394 | | ctx.get_tags(Some(subject)).await?; +395 | | Ok(ReplAction::Continue) +396 | | } + | |_________^ +... +410 | / (None, ["tag" | "label" | "link", "list" | "ls", subject]) => { +411 | | ctx.get_tags(Some(subject)).await?; +412 | | Ok(ReplAction::Continue) +413 | | } + | |_________^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +393 ~ (None, ["tags" | "labels" | "links", subject]) | (None, ["tag" | "label" | "link", "list" | "ls", subject]) => { +394 | ctx.get_tags(Some(subject)).await?; +... +409 | } +410 ~ (None, ["migrate-tags" | "migrate"]) => { + | + +error: very complex type used. Consider factoring parts into `type` definitions + --> src/search.rs:106:22 + | +106 | ...d: Vec<(BTreeSet<[u8; 32]>, BTreeMap<[u8; 32], BTreeSet<[u8; 32]>>)> = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#type_complexity + = note: `-D clippy::type-complexity` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::type_complexity)]` + +warning: first doc comment paragraph is too long + --> src/search.rs:192:1 + | +192 | / /// The multi-term search over the store's live claims, read by [`Eve... +193 | | /// [`Term::SubjectKind`] resolves through the store: the subject's e... +194 | | /// [`EventStore::event_by_id`], and the kind in its header extension. +195 | | /// +196 | | /// # Errors + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph +help: add an empty line + | +192 | /// The multi-term search over the store's live claims, read by [`EventStore::tag_claims`]. +193 + /// + | + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/seitan/accept.rs:119:61 + | +119 | let wire: Wire = rmp_serde::from_slice(message).map_err(|_| ProofEr... + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + = note: requested on the command line with `-W clippy::map-err-ignore` + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/seitan/accept.rs:140:60 + | +140 | let key = VerifyingKey::from_bytes(public_key).map_err(|_| ProofErr... + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/seitan/accept.rs:143:18 + | +143 | .map_err(|_| ProofError::BadSignature) + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: first doc comment paragraph is too long + --> src/server_config/mod.rs:93:1 + | +93 | / /// The server's serving policy: the operator-set knobs of the freshne... +94 | | /// pull policy (P6.5). Both have code defaults, so a config that sets... +95 | | /// as before: a five-minute window and open pull. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: this could be a `const fn` + --> src/server_config/mod.rs:196:5 + | +196 | / pub fn freshness(&self) -> Freshness { +197 | | Freshness { +198 | | server: self.policy.freshness_window, +199 | | world: None, +... | +202 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +196 | pub const fn freshness(&self) -> Freshness { + | +++++ + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/shell_contract.rs:174:30 + | +174 | .map_err(|_| format!("unknown field type `{name}`"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: consider adding a `;` to the last statement for consistent formatting + --> src/shell_contract.rs:434:17 + | +434 | ... check_value(field, value).map_err(|error| format!("`{kind}.{name}` {error}"))? + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `check_value(field, value).map_err(|error| format!("`{kind}.{name}` {error}"))?;` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#semicolon_if_nothing_returned + = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::semicolon_if_nothing_returned)]` + +warning: first doc comment paragraph is too long + --> src/tag_claims.rs:158:1 + | +158 | / /// The events that `start` reaches by following parent links: its ow... +159 | | /// `parents` maps each event to the events it names, its `after` has... +160 | | /// starting events are included. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph +help: add an empty line + | +158 | /// The events that `start` reaches by following parent links: its own causal past, transitively. +159 + /// + | + +warning: parameter of type `HashMap` should be generalized over different hashers + --> src/tag_claims.rs:162:46 + | +162 | ...t: &[Hash], parents: &HashMap>) -> HashSet { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#implicit_hasher + = note: `-W clippy::implicit-hasher` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::implicit_hasher)]` +help: add a type parameter for `BuildHasher` + | +162 | pub fn causal_past(start: &[Hash], parents: &HashMap, S>) -> HashSet { + | +++++++++++++++++++++++++++++ +++ + +warning: parameter of type `HashMap` should be generalized over different hashers + --> src/tag_claims.rs:182:51 + | +182 | ...&[Applied], parents: &HashMap>) -> Vec { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#implicit_hasher +help: add a type parameter for `BuildHasher` + | +182 | pub fn live_claims(applied: &[Applied], parents: &HashMap, S>) -> Vec { + | +++++++++++++++++++++++++++++ +++ + +warning: parameter of type `HashMap` should be generalized over different hashers + --> src/tag_claims.rs:232:56 + | +232 | ...&[Applied], parents: &HashMap>) -> Vec { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#implicit_hasher +help: add a type parameter for `BuildHasher` + | +232 | pub fn compacted_claims(applied: &[Applied], parents: &HashMap, S>) -> Vec { + | +++++++++++++++++++++++++++++ +++ + +warning: casting `u128` to `u64` may truncate the value + --> src/time.rs:10:30 + | +10 | .map_or(0, |elapsed| elapsed.as_millis() as u64) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +10 - .map_or(0, |elapsed| elapsed.as_millis() as u64) +10 + .map_or(0, |elapsed| u64::try_from(elapsed.as_millis())) + | + +warning: statement has unnecessary safety comment + --> src/tuple.rs:332:13 + | +332 | let u = v as u64; + | ^^^^^^^^^^^^^^^^^ + | +help: consider removing the safety comment + --> src/tuple.rs:330:16 + | +330 | // Safety: v > 0 so cast to u64 is lossless + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unnecessary_safety_comment + = note: requested on the command line with `-W clippy::unnecessary-safety-comment` + +warning: this argument is passed by value, but not consumed in the function body + --> src/world/actor.rs:331:34 + | +331 | fn persist(&mut self, entry: JournalEntry) -> Result<()> { + | ^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +331 | fn persist(&mut self, entry: &JournalEntry) -> Result<()> { + | + + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world/actor.rs:360:5 + | +360 | / async fn deliver(&mut self, text: String) -> bool { +361 | | if !self.program_healthy || self.storage_failed { +362 | | return false; +... | +394 | | journaled +395 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl + = note: `-W clippy::unused-async-trait-impl` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_async_trait_impl)]` +help: consider removing the `async` from this function and returning `impl Future` instead + | +360 ~ fn deliver(&mut self, text: String) -> impl Future { +361 | if !self.program_healthy || self.storage_failed { +362 ~ return std::future::ready(false); +363 | } +364 | if text.len() > crate::world_caps::MAX_EVENT_BYTES { +365 | tracing::error!("world event exceeds the delivery bound; dropped"); +366 ~ return std::future::ready(false); +367 | } +... +375 | tracing::error!("world program rejected a host event: {error:#}"); +376 ~ return std::future::ready(false); +377 | } +... +385 | tracing::error!("world program records failed: {error:#}"); +386 ~ return std::future::ready(false); +387 | } +... +393 | let _ = self.view_changed.send(self.core.sequence); +394 ~ std::future::ready(journaled) + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/world/actor.rs:584:21 + | +584 | / request +585 | | .args +586 | | .get("count") +587 | | .and_then(serde_json::Value::as_u64) +588 | | .unwrap_or(16) +589 | | .min(crate::world_caps::MAX_CHAT_HISTORY_LINES as u64) as usize, + | |_______________________________________________________________________________________^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +584 ~ usize::try_from(request +585 + .args +586 + .get("count") +587 + .and_then(serde_json::Value::as_u64) +588 + .unwrap_or(16) +589 ~ .min(crate::world_caps::MAX_CHAT_HISTORY_LINES as u64)), + | + +warning: using `.clone()` on a ref-counted pointer + --> src/world/actor.rs:620:23 + | +620 | let records = self.records_sender.borrow().1.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&self.records_sender.borrow().1)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + = note: requested on the command line with `-W clippy::clone-on-ref-ptr` + +warning: this function's return value is unnecessarily wrapped by `Result` + --> src/world/actor.rs:907:5 + | +907 | fn caps_report(&mut self) -> Result { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unnecessary_wraps + = note: `-W clippy::unnecessary-wraps` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::unnecessary_wraps)]` +help: remove `Result` from the return type... + | +907 - fn caps_report(&mut self) -> Result { +907 + fn caps_report(&mut self) -> world_caps::CapsReport { + | +help: ...and then remove the surrounding `Ok()` from returning expressions + | +922 ~ CapsReport { +923 + granted, +924 + requested, +925 + missing, +926 + usage: self.core.ledger.usage().clone(), +927 + policy: if self.core.ledger.grant_on_use() { +928 + "grant-on-use" +929 + } else { +930 + "deny" +931 + } +932 + .to_owned(), +933 + catalog: crate::world_caps::CATALOG +934 + .iter() +935 + .map(|name| (*name).to_owned()) +936 + .collect(), +937 + ceiling: self.core.caps_ceiling.iter().cloned().collect(), +938 + effective, +939 + view_failures: self.view_failures, +940 + } + | + +warning: these match arms have identical bodies + --> src/world/actor.rs:912:13 + | +912 | Ok(None) => Vec::new(), + | ^^^^^^^^^^^^^^^^^^^^^^ +913 | Err(_) => Vec::new(), + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +912 ~ Ok(None) | Err(_) => Vec::new(), +913 ~ }; + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world/actor.rs:1398:5 + | +1398 | / async fn compact_if_due(&mut self) { +1399 | | if self.compaction_off +1400 | | || self.storage_failed +1401 | | || !self.program_healthy +... | +1420 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future` instead + | +1398 ~ fn compact_if_due(&mut self)impl Future { +1399 | if self.compaction_off + ... +1409 | let started = std::time::Instant::now(); +1410 ~ std::future::ready(match compact_journal(&mut self.core, self.program.as_mut(), journal.as_mut()) { +1411 + Ok(true) => self.metrics.record_checkpoint(started.elapsed()), +1412 + Ok(false) => self.compaction_off = true, +1413 + Err(error) => { +1414 + // The journal is still complete; just do not retry until +1415 + // something changes. +1416 + tracing::warn!("world checkpoint skipped: {error:#}"); +1417 + self.compaction_off = true; +1418 + } +1419 + }) + | + +warning: these match arms have identical bodies + --> src/world/core.rs:294:17 + | +294 | JournalEntry::BuilderInstalled { .. } => {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +295 | // Audit-only: the copied entries alread... +296 | JournalEntry::Forked { .. } => {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +294 ~ JournalEntry::BuilderInstalled { .. } | JournalEntry::Forked { .. } => {} +295 | // Audit-only: the copied entries already reproduce the parent. +296 ~ JournalEntry::System { event } => { + | + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/world/core.rs:334:29 + | +334 | ... core.active_module_provenance = provenance.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `core.active_module_provenance.clone_from(provenance)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + = note: `-W clippy::assigning-clones` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::assigning_clones)]` + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/world/core.rs:379:21 + | +379 | core.active_module_provenance = provenance.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `core.active_module_provenance.clone_from(&provenance)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:121:22 + | +121 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:189:22 + | +189 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:223:22 + | +223 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:235:22 + | +235 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:253:22 + | +253 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:271:22 + | +271 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:288:22 + | +288 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:313:22 + | +313 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:329:22 + | +329 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:354:22 + | +354 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:371:22 + | +371 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:398:22 + | +398 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:414:22 + | +414 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:430:22 + | +430 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:442:22 + | +442 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:474:22 + | +474 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:498:22 + | +498 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:525:22 + | +525 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:549:22 + | +549 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:564:22 + | +564 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:586:22 + | +586 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:602:22 + | +602 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:618:22 + | +618 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:630:22 + | +630 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:653:22 + | +653 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:669:22 + | +669 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:682:22 + | +682 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:705:22 + | +705 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:756:22 + | +756 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world/handle.rs:768:22 + | +768 | .map_err(|_| anyhow::anyhow!("world actor is closed"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +error: using `chunks_exact` with a constant chunk size + --> src/world/util.rs:62:50 + | +62 | for (slot, pair) in out.iter_mut().zip(bytes.chunks_exact(2)) { + | ^^^^^^^^^^^^^^^ + | +help: consider using `as_chunks::<2>()` instead + --> src/world/util.rs:62:50 + | +62 | for (slot, pair) in out.iter_mut().zip(bytes.chunks_exact(2)) { + | ^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#chunks_exact_to_as_chunks + +warning: item in documentation is missing backticks + --> src/world_caps.rs:30:61 + | +30 | //! part of the wire contract and never change meaning; the DoS suite as... + | ^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +30 - //! part of the wire contract and never change meaning; the DoS suite asserts +30 + //! part of the wire contract and never change meaning; the `DoS` suite asserts + | + +warning: this argument is passed by value, but not consumed in the function body + --> src/world_caps.rs:333:54 + | +333 | pub fn subscription_refused_event(spec: &str, error: CapError) -> String { + | ^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +333 | pub fn subscription_refused_event(spec: &str, error: &CapError) -> String { + | + + +warning: item in documentation is missing backticks + --> src/world_caps.rs:355:70 + | +355 | /// These are documented in the capability guide and asserted by the DoS + | ^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +355 - /// These are documented in the capability guide and asserted by the DoS +355 + /// These are documented in the capability guide and asserted by the `DoS` + | + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/world_compile.rs:285:17 + | +285 | use std::io::Read; + | ^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/world_compile.rs:291:17 + | +291 | use std::io::Read; + | ^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: allocating a local array larger than 16384 bytes + --> src/world_compile.rs:365:22 + | +365 | let mut buffer = [0_u8; 64 * 1024]; + | ^^^^^^^^^^^^^^^^^ + | + = help: consider allocating on the heap with `vec![0_u8; 64 * 1024].into_boxed_slice()` + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#large_stack_arrays + = note: `-W clippy::large-stack-arrays` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::large_stack_arrays)]` + +warning: allocating a local array larger than 16384 bytes + --> src/world_compile.rs:410:30 + | +410 | let mut buffer = [0_u8; 64 * 1024]; + | ^^^^^^^^^^^^^^^^^ + | + = help: consider allocating on the heap with `vec![0_u8; 64 * 1024].into_boxed_slice()` + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#large_stack_arrays + +warning: function has unnecessary safety comment + --> src/world_compile.rs:531:1 + | +531 | fn apply_rlimits() -> std::io::Result<()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: consider removing the safety comment + --> src/world_compile.rs:529:5 + | +529 | /// Safety: runs between fork and exec; only async-signal-safe calls + | ^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unnecessary_safety_comment + +warning: `format!(..)` appended to existing `String` + --> src/world_doctor.rs:104:13 + | +104 | / out.push_str(&format!( +105 | | "{tag:4} {:<9} {}\n", +106 | | finding.check, finding.detail +107 | | )); + | |______________^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string + = note: requested on the command line with `-W clippy::format-push-string` +help: consider using `write!` to avoid the extra allocation + | +104 ~ let _ = write!(out, "{tag:4} {:<9} {}\n", +105 ~ finding.check, finding.detail); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_doctor.rs:109:17 + | +109 | out.push_str(&format!(" fix: {}\n", finding.fix)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +109 - out.push_str(&format!(" fix: {}\n", finding.fix)); +109 + let _ = write!(out, " fix: {}\n", finding.fix); + | + +warning: function call inside of `or` + --> src/world_fixture.rs:236:42 + | +236 | let extra = first.get(index).or(second.get(index))?; + | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_else(|| second.get(index))` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#or_fun_call + = note: `-W clippy::or-fun-call` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::or_fun_call)]` + +warning: first doc comment paragraph is too long + --> src/world_hub.rs:145:1 + | +145 | / /// The JSON shape of a world directory listing: the shared serialize... +146 | | /// directory feed (#812). The CLI's `id world list --json` prints ex... +147 | | /// and the web UI's directory surface is expected to consume the sam... +148 | | /// +149 | | /// The shape is `{ "default": , "worlds": [{ "name": ..., "loa... + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:298:22 + | +298 | .map_err(|_| ResolveError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:304:22 + | +304 | .map_err(|_| ResolveError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:478:43 + | +478 | validate_world_name(name).map_err(|_| ResolveError::InvalidName)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:481:22 + | +481 | .map_err(|_| ResolveError::Busy)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:544:22 + | +544 | .map_err(|_| ResolveError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:617:43 + | +617 | validate_world_name(name).map_err(|_| ResolveError::InvalidName)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_hub.rs:631:22 + | +631 | .map_err(|_| ResolveError::Busy)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: avoid using `collect()` when not needed + --> src/world_hub.rs:679:18 + | +679 | .collect(); + | ^^^^^^^ +680 | / names +681 | | .into_iter() + | |____________________________- the iterator could be used here instead + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_collect + = note: `-W clippy::needless-collect` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::needless_collect)]` +help: use the original Iterator instead of collecting it and then producing a new one + | +671 ~ +672 ~ slots +673 + .iter() +674 + .filter(|(_, slot)| { +675 + slot.service.get().is_some() +676 + && slot.leases.load(Ordering::Acquire) == 0 +677 + && slot.idle_for() >= idle +678 + }) +679 + .map(|(name, _)| name.clone()) + | + +error: this `impl` can be derived + --> src/world_manifest.rs:75:1 + | +75 | / impl Default for WorldState { +76 | | fn default() -> Self { +77 | | Self { +78 | | module_hash: None, +... | +86 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#derivable_impls + = note: `-D clippy::derivable-impls` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::derivable_impls)]` +help: replace the manual implementation with a derive attribute + | +60 + #[derive(Default)] +61 | pub struct WorldState { + | + +warning: this could be a `const fn` + --> src/world_manifest.rs:134:5 + | +134 | / pub fn kind(&self) -> &'static str { +135 | | match self { +136 | | Self::InstallModule { .. } => "install_module", +137 | | Self::SetGrants { .. } => "set_grants", +... | +143 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +134 | pub const fn kind(&self) -> &'static str { + | +++++ + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/world_manifest.rs:326:21 + | +326 | state.grants = grants.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `state.grants.clone_from(grants)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/world_manifest.rs:335:21 + | +335 | state.ceiling = ceiling.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `state.ceiling.clone_from(ceiling)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:381:21 + | +381 | ... out.push_str(&format!("- module {hash} (seed {seed})\n")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +381 - out.push_str(&format!("- module {hash} (seed {seed})\n")); +381 + let _ = write!(out, "- module {hash} (seed {seed})\n"); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:384:21 + | +384 | / out.push_str(&format!( +385 | | "+ module source {} (seed {seed})\n", +386 | | source.display() +387 | | )); + | |______________________^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +384 ~ let _ = write!(out, "+ module source {} (seed {seed})\n", +385 ~ source.display()); + | + +warning: consider adding a `;` to the last statement for consistent formatting + --> src/world_manifest.rs:391:17 + | +391 | ... out.push_str(&format!("~ grants [{}]\n", grants.join(", "))) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `out.push_str(&format!("~ grants [{}]\n", grants.join(", ")));` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#semicolon_if_nothing_returned + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:391:17 + | +391 | ... out.push_str(&format!("~ grants [{}]\n", grants.join(", "))) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +391 - out.push_str(&format!("~ grants [{}]\n", grants.join(", "))) +391 + let _ = write!(out, "~ grants [{}]\n", grants.join(", ")) + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:395:21 + | +395 | ... out.push_str(&format!("~ ceiling [{}]\n", names.join(", "))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +395 - out.push_str(&format!("~ ceiling [{}]\n", names.join(", "))); +395 + let _ = write!(out, "~ ceiling [{}]\n", names.join(", ")); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:400:17 + | +400 | out.push_str(&format!("~ profile {profile:?}\n")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +400 - out.push_str(&format!("~ profile {profile:?}\n")); +400 + let _ = write!(out, "~ profile {profile:?}\n"); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:403:17 + | +403 | out.push_str(&format!("+ schedule {id} at {at_ms}\n")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +403 - out.push_str(&format!("+ schedule {id} at {at_ms}\n")); +403 + let _ = write!(out, "+ schedule {id} at {at_ms}\n"); + | + +warning: `format!(..)` appended to existing `String` + --> src/world_manifest.rs:406:17 + | +406 | out.push_str(&format!("- schedule {id}\n")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +406 - out.push_str(&format!("- schedule {id}\n")); +406 + let _ = write!(out, "- schedule {id}\n"); + | + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_native.rs:116:22 + | +116 | .map_err(|_| anyhow::anyhow!("native worker is gone"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: casting `u64` to `u32` may truncate the value + --> src/world_native.rs:243:27 + | +243 | let participant = participant.min(u64::from(u32::MAX)) as u32; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +243 - let participant = participant.min(u64::from(u32::MAX)) as u32; +243 + let participant = u32::try_from(participant.min(u64::from(u32::MAX))); + | + +warning: casting `i64` to `i32` may truncate the value + --> src/world_native.rs:340:46 + | +340 | let root = unsafe { OwnedFd::from_raw_fd(fd as i32) }; + | ^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +340 - let root = unsafe { OwnedFd::from_raw_fd(fd as i32) }; +340 + let root = unsafe { OwnedFd::from_raw_fd(i32::try_from(fd)) }; + | + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/world_native.rs:409:9 + | +409 | / struct LandlockRulesetAttr { +410 | | handled_access_fs: u64, +411 | | handled_access_net: u64, +412 | | scoped: u64, +413 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/world_native.rs:430:9 + | +430 | / struct LandlockPathBeneathAttr { +431 | | allowed_access: u64, +432 | | parent_fd: i32, +433 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: casting `i64` to `u64` may lose the sign of the value + --> src/world_native.rs:442:13 + | +442 | ruleset as libc::c_ulong, + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, use `cast_unsigned()` instead: `ruleset.cast_unsigned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_sign_loss + = note: `-W clippy::cast-sign-loss` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_sign_loss)]` + +warning: casting `i64` to `u64` may lose the sign of the value + --> src/world_native.rs:453:13 + | +453 | ruleset as libc::c_ulong, + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, use `cast_unsigned()` instead: `ruleset.cast_unsigned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_sign_loss + +warning: casting `u32` to `i32` may wrap around the value + --> src/world_native.rs:469:69 + | +469 | ..._raw_os_error(1003 + resource as i32)); + | ^^^^^^^^^^^^^^^ help: if this is intentional, use `cast_signed()` instead: `resource.cast_signed()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_wrap + = note: `-W clippy::cast-possible-wrap` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_wrap)]` + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_native.rs:487:49 + | +487 | len: u16::try_from(program_len).map_err(|_| { + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: casting `usize` to `u8` may truncate the value + --> src/world_native.rs:687:13 + | +687 | jf: (ret_kill_index - 2) as u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +687 - jf: (ret_kill_index - 2) as u8, +687 + jf: u8::try_from(ret_kill_index - 2), + | + +warning: casting `usize` to `u8` may truncate the value + --> src/world_native.rs:698:17 + | +698 | jt: ((ret_allow_index - (3 + index)) - 1) as u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +698 - jt: ((ret_allow_index - (3 + index)) - 1) as u8, +698 + jt: u8::try_from((ret_allow_index - (3 + index)) - 1), + | + +warning: casting `usize` to `u8` may truncate the value + --> src/world_native.rs:707:17 + | +707 | ...t: ((ret_kill_index + 1 + index * 4) - (3 + plain + index) - 1) as u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +707 - jt: ((ret_kill_index + 1 + index * 4) - (3 + plain + index) - 1) as u8, +707 + jt: u8::try_from((ret_kill_index + 1 + index * 4) - (3 + plain + index) - 1), + | + +warning: casting `usize` to `u8` may truncate the value + --> src/world_native.rs:737:17 + | +737 | jt: (ret_allow_index - jeq_index - 1) as u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +737 - jt: (ret_allow_index - jeq_index - 1) as u8, +737 + jt: u8::try_from(ret_allow_index - jeq_index - 1), + | + +warning: missing `#[must_use]` attribute on a method returning `Self` + --> src/world_presentation.rs:83:5 + | + 83 | / pub fn fit(&self, width: usize, height: usize) -> Self { + 84 | | let width = width.min(usize::from(self.width)); + 85 | | let height = height.min(usize::from(self.height)); + 86 | | let mut cells = Vec::with_capacity(width * height); +... | +109 | | } + | |_____^ + | + = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#return_self_not_must_use + = note: `-W clippy::return-self-not-must-use` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::return_self_not_must_use)]` + +error: this `if` statement can be collapsed + --> src/world_presentation.rs:90:13 + | + 90 | / if row.last().is_some_and(|cell| cell.columns == 2) { + 91 | | if let Some(last) = row.last_mut() { + 92 | | *last = ScreenCell { + 93 | | symbol: " ".to_owned(), +... | +100 | | } + | |_____________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | + 90 ~ if row.last().is_some_and(|cell| cell.columns == 2) + 91 ~ && let Some(last) = row.last_mut() { + 92 | *last = ScreenCell { +... + 98 | }; + 99 ~ } + | + +warning: this could be a `const fn` + --> src/world_session/mod.rs:189:5 + | +189 | / pub(crate) fn frame_meter(&self) -> &WorldMetrics { +190 | | &self.metrics +191 | | } + | |_____^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +189 | pub(crate) const fn frame_meter(&self) -> &WorldMetrics { + | +++++ + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:262:22 + | +262 | .map_err(|_| anyhow::anyhow!("admin denied"))?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:409:22 + | +409 | .map_err(|_| InstallError::Unavailable) + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +error: this function has too many arguments (8/7) + --> src/world_session/mod.rs:506:5 + | +506 | / async fn install_wasm_reserved( +507 | | &self, +508 | | supplied_admin: Option<&str>, +509 | | wasm: Vec, +... | +514 | | provenance: Option, +515 | | ) -> Result<(String, u64), InstallError> { + | |____________________________________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_many_arguments + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:550:26 + | +550 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:549:26 + | +549 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:559:26 + | +559 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:565:30 + | +565 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:573:26 + | +573 | .map_err(|_| InstallError::InvalidModule)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:571:26 + | +571 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:595:26 + | +595 | .map_err(|_| InstallError::InvalidModule)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:593:26 + | +593 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:603:22 + | +603 | .map_err(|_| InstallError::InvalidModule)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:602:22 + | +602 | .map_err(|_| InstallError::InvalidModule)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:614:26 + | +614 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:613:26 + | +613 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:633:45 + | +633 | ... let pin = pin.await.map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:650:22 + | +650 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:677:22 + | +677 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:693:22 + | +693 | .map_err(|_| InstallError::InvalidUpload)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:709:26 + | +709 | .map_err(|_| InstallError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:708:26 + | +708 | .map_err(|_| InstallError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: these match arms have identical bodies + --> src/world_session/mod.rs:747:9 + | +747 | / ClientFrame::Invite { admin_token, .. } +748 | | | ClientFrame::InstallBegin { admin_token, .. } +749 | | | ClientFrame::Compile { admin_token, .. } +750 | | | ClientFrame::CreateWorld { admin_token } +751 | | | ClientFrame::ListWorlds { admin_token } => Some(admin_token), + | |______________________________________________________________________^ +752 | ClientFrame::SetExecutionProfile { admin_token, .. } => Some(admin_token), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +747 ~ ClientFrame::Invite { admin_token, .. } +748 + | ClientFrame::InstallBegin { admin_token, .. } +749 + | ClientFrame::Compile { admin_token, .. } +750 + | ClientFrame::CreateWorld { admin_token } +751 ~ | ClientFrame::ListWorlds { admin_token } | ClientFrame::SetExecutionProfile { admin_token, .. } => Some(admin_token), + | + +warning: `to_string()` called on a `&str` + --> src/world_session/mod.rs:1284:55 + | +1284 | let token = JoinCapability::from_wire(cap.to_string()); + | ^^^^^^^^^^^^^^^ help: try: `cap.to_owned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#str_to_string + = note: requested on the command line with `-W clippy::str-to-string` + +warning: `to_string()` called on a `&str` + --> src/world_session/mod.rs:1317:55 + | +1317 | let token = JoinCapability::from_wire(cap.to_string()); + | ^^^^^^^^^^^^^^^ help: try: `cap.to_owned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#str_to_string + +warning: unnecessary boolean `not` operation + --> src/world_session/mod.rs:1322:13 + | +1322 | / ... if !auth_ok { +1323 | | ... let _ = send_error(service.frame_meter(), io, "access deni... +1324 | | ... } else { +1325 | | ... match service.world().execution_profile().await { +... | +1344 | | ... } + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#if_not_else +help: try + | +1322 ~ if auth_ok { +1323 + match service.world().execution_profile().await { +1324 + Ok(profile) => { +1325 + let _ = send_json( +1326 + service.frame_meter(), +1327 + io, +1328 + &ServerFrame::ExecutionProfile { +1329 + update: crate::world::ExecutionProfileUpdate { +1330 + requested: profile, +1331 + applies_on_next_program_install_or_process_restart: false, +1332 + }, +1333 + message: "current persisted execution profile", +1334 + }, +1335 + ) +1336 + .await; +1337 + } +1338 + Err(error) => { +1339 + let _ = send_error(service.frame_meter(), io, &format!("{error:#}")).await; +1340 + } +1341 + } +1342 + } else { +1343 + let _ = send_error(service.frame_meter(), io, "access denied").await; +1344 + } + | + +warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` + --> src/world_session/mod.rs:1477:17 + | +1477 | / match service.world().snapshot(token).await { +1478 | | Ok(_) => match service.world().metrics().await { +1479 | | Ok(metrics) => { +1480 | | if !send_json( +... | +1500 | | } + | |_________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_match_else +help: try + | +1477 ~ if let Ok(_) = service.world().snapshot(token).await { match service.world().metrics().await { +1478 + Ok(metrics) => { +1479 + if !send_json( +1480 + service.frame_meter(), +1481 + io, +1482 + &ServerFrame::Metrics { metrics }, +1483 + ) +1484 + .await +1485 + { +1486 + return; +1487 + } +1488 + } +1489 + Err(error) => { +1490 + let _ = +1491 + send_error(service.frame_meter(), io, &format!("{error:#}")).await; +1492 + return; +1493 + } +1494 + } } else { +1495 + let _ = send_error(service.frame_meter(), io, "join denied").await; +1496 + return; +1497 + } + | + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1660:18 + | +1660 | .map_err(|_| "module bytes are unavailable")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1681:18 + | +1681 | .map_err(|_| "the host does not hold a module with that hash")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1753:18 + | +1753 | .map_err(|_| "world is busy installing another module")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1777:26 + | +1777 | .map_err(|_| "timed out receiving module")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_session/mod.rs:1800:22 + | +1800 | .map_err(|_| "timed out waiting for install completion")?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: function call inside of `map_or` + --> src/world_session/mod.rs:2061:43 + | +2061 | ... let screen = viewport.map_or(screen.clone(), |viewport| { + | _____________________________^ +2062 | | ... screen.fit(viewport.width, viewport.height) +2063 | | ... }); + | |________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#or_fun_call +help: try + | +2061 ~ let screen = viewport.map_or_else(|| screen.clone(), |viewport| { +2062 + screen.fit(viewport.width, viewport.height) +2063 ~ }); + | + +error: using `chunks_exact` with a constant chunk size + --> src/world_session/mod.rs:2496:10 + | +2496 | .chunks_exact(2) + | ^^^^^^^^^^^^^^^ help: consider using `as_chunks` instead: `as_chunks::<2>().0.iter()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#chunks_exact_to_as_chunks + +warning: first doc comment paragraph is too long + --> src/world_ssh.rs:83:1 + | +83 | / /// ALPN for SSH-over-iroh tunnels (F13.3): each bidirectional stream ... +84 | | /// raw SSH connection forwarded to the host's own SSH server. The tunnel +85 | | /// carries bytes only; SSH authentication happens inside it, unchanged. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:283:5 + | +283 | / async fn auth_password(&mut self, user: &str, password: &str) -> ... +284 | | if self.permit.is_none() { +285 | | return Ok(Auth::reject()); +... | +302 | | Ok(Auth::Accept) +303 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +283 ~ fn auth_password(&mut self, user: &str, password: &str) -> impl Future> { +284 | if self.permit.is_none() { +285 ~ return std::future::ready(Ok(Auth::reject())); +286 | } +... +301 | }); +302 ~ std::future::ready(Ok(Auth::Accept)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:305:5 + | +305 | / async fn auth_publickey( +306 | | &mut self, +307 | | user: &str, +308 | | public_key: &PublicKey, +... | +326 | | Ok(Auth::Accept) +327 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +305 ~ fn auth_publickey( +306 | &mut self, +307 | user: &str, +308 | public_key: &PublicKey, +309 ~ ) -> impl Future> { +310 | let Some(world) = user.strip_prefix(EXPLORE_PREFIX) else { +311 ~ return std::future::ready(Ok(Auth::reject())); +312 | }; +313 | let Some(ed25519) = public_key.key_data().ed25519() else { +314 ~ return std::future::ready(Ok(Auth::reject())); +315 | }; +316 | if self.permit.is_none() { +317 ~ return std::future::ready(Ok(Auth::reject())); +318 | } +... +325 | }); +326 ~ std::future::ready(Ok(Auth::Accept)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:359:5 + | +359 | / async fn exec_request( +360 | | &mut self, +361 | | channel: ChannelId, +362 | | data: &[u8], +... | +390 | | Ok(()) +391 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +359 ~ fn exec_request( +360 | &mut self, +... +363 | session: &mut Session, +364 ~ ) -> impl Future> { +365 | // The frame protocol is the only command, and one session (shell or +... +371 | { +372 ~ return std::future::ready(session.channel_failure(channel)); +373 | } +374 | let (exec, bytes) = mpsc::unbounded_channel(); +375 | self.exec = Some(exec); +376 ~ std::future::ready(session.channel_success(channel)?); +377 | let mut io = SshFrameIo { +... +389 | }); +390 ~ std::future::ready(Ok(())) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:393:5 + | +393 | / async fn subsystem_request( +394 | | &mut self, +395 | | channel: ChannelId, +396 | | _name: &str, +... | +399 | | session.channel_failure(channel) +400 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +393 ~ fn subsystem_request( +394 | &mut self, +... +397 | session: &mut Session, +398 ~ ) -> impl Future> { +399 ~ std::future::ready(session.channel_failure(channel)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:412:5 + | +412 | / async fn pty_request( +413 | | &mut self, +414 | | channel: ChannelId, +415 | | _term: &str, +... | +424 | | session.channel_success(channel) +425 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +412 ~ fn pty_request( +413 | &mut self, +... +421 | session: &mut Session, +422 ~ ) -> impl Future> { +423 | self.viewport = Some((col_width, row_height)); +424 ~ std::future::ready(session.channel_success(channel)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:427:5 + | +427 | / async fn window_change_request( +428 | | &mut self, +429 | | channel: ChannelId, +430 | | col_width: u32, +... | +440 | | session.channel_success(channel) +441 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +427 ~ fn window_change_request( +428 | &mut self, +... +434 | session: &mut Session, +435 ~ ) -> impl Future> { +436 | self.viewport = Some((col_width, row_height)); +... +439 | } +440 ~ std::future::ready(session.channel_success(channel)) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:443:5 + | +443 | / async fn shell_request( +444 | | &mut self, +445 | | channel: ChannelId, +446 | | session: &mut Session, +... | +512 | | Ok(()) +513 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +443 ~ fn shell_request( +444 | &mut self, +445 | channel: ChannelId, +446 | session: &mut Session, +447 ~ ) -> impl Future> { +448 | let Some(login) = self +... +452 | else { +453 ~ return std::future::ready(session.channel_failure(channel)); +454 | }; +... +459 | let handle = session.handle(); +460 ~ std::future::ready(session.channel_success(channel)?); +461 | let dropped_input = Arc::clone(&self.dropped_input); +... +468 | )); +469 ~ return std::future::ready(Ok(())); +470 | } +471 | let first = join_frame(login); +472 ~ std::future::ready(session.channel_success(channel)?); +473 | let alt_screen = !login.command_mode; +... +511 | }); +512 ~ std::future::ready(Ok(())) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:515:5 + | +515 | / async fn data( +516 | | &mut self, +517 | | _channel: ChannelId, +518 | | data: &[u8], +... | +553 | | Ok(()) +554 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +515 ~ fn data( +516 | &mut self, +... +519 | _session: &mut Session, +520 ~ ) -> impl Future> { +521 | if let Some(exec) = &self.exec { +... +528 | } +529 ~ return std::future::ready(Ok(())); +530 | } +531 | let Some(input) = &self.input else { +532 ~ return std::future::ready(Ok(())); +533 | }; +... +552 | } +553 ~ std::future::ready(Ok(())) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:556:5 + | +556 | / async fn channel_eof( +557 | | &mut self, +558 | | _channel: ChannelId, +559 | | _session: &mut Session, +... | +563 | | Ok(()) +564 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +556 ~ fn channel_eof( +557 | &mut self, +558 | _channel: ChannelId, +559 | _session: &mut Session, +560 ~ ) -> impl Future> { +561 | self.input = None; +562 | self.exec = None; +563 ~ std::future::ready(Ok(())) + | + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:566:5 + | +566 | / async fn channel_close( +567 | | &mut self, +568 | | _channel: ChannelId, +569 | | _session: &mut Session, +... | +573 | | Ok(()) +574 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +566 ~ fn channel_close( +567 | &mut self, +568 | _channel: ChannelId, +569 | _session: &mut Session, +570 ~ ) -> impl Future> { +571 | self.input = None; +572 | self.exec = None; +573 ~ std::future::ready(Ok(())) + | + +warning: use of `Option>` + --> src/world_ssh.rs:690:21 + | +690 | records_prefix: Option>, + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider using `Option`, or a custom enum if you need to distinguish all 3 cases + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#option_option + = note: `-W clippy::option-option` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::option_option)]` + +error: this `if` statement can be collapsed + --> src/world_ssh.rs:887:9 + | +887 | / ... if let Some((bytes, notice)) = claim_dropped_input_notice(&self... +888 | | ... if self.handle.data(self.channel, notice).await.is_err() { +889 | | ... self.dropped_input.fetch_add(bytes, Ordering::Relaxed); +890 | | ... return false; +891 | | ... } +892 | | ... } + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +887 ~ if let Some((bytes, notice)) = claim_dropped_input_notice(&self.dropped_input) +888 ~ && self.handle.data(self.channel, notice).await.is_err() { +889 | self.dropped_input.fetch_add(bytes, Ordering::Relaxed); +890 | return false; +891 ~ } + | + +warning: variables can be used directly in the `format!` string + --> src/world_ssh.rs:928:21 + | +928 | / ... format!( +929 | | ... "\x1b[H\x1b[2J{}\r\nType a line to chat; /help lists comman... +930 | | ... rendered +931 | | ... ) + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#uninlined_format_args + +warning: first doc comment paragraph is too long + --> src/world_ssh.rs:995:1 + | +995 | / /// Where `id world join --via ssh` connects: `[user@]host[:port]` (p... +996 | | /// by default; an IPv6 address goes in brackets). The user is only t... +997 | | /// login: on the frame channel it names no world and grants nothing. + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_long_first_doc_paragraph + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_ssh.rs:1016:26 + | +1016 | .map_err(|_| anyhow::anyhow!("`{digits}` is not a port")) + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:1068:5 + | +1068 | / async fn check_server_key( +1069 | | &mut self, +1070 | | key: &russh::keys::PublicKeyOrCertificate, +1071 | | ) -> Result { +... | +1087 | | Ok(trusted) +1088 | | } + | |_____^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +1068 ~ fn check_server_key( +1069 | &mut self, +1070 | key: &russh::keys::PublicKeyOrCertificate, +1071 ~ ) -> impl Future> { +1072 | let russh::keys::PublicKeyOrCertificate::PublicKey { key, .. } = key else { +1073 | self.refuse("a certificate (not supported)".to_owned()); +1074 ~ return std::future::ready(Ok(false)); +1075 | }; + ... +1086 | } +1087 ~ std::future::ready(Ok(trusted)) + | + +warning: unnecessary boolean `not` operation + --> src/world_ssh.rs:1307:17 + | +1307 | / if !self.overflow { +1308 | | let bytes = std::mem::take(&mut self.line); +1309 | | let line = String::from_utf8_lossy(&bytes); +1310 | | if let Some(command) = world_command(&line) { +... | +1314 | | self.line.clear(); +1315 | | } + | |_________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#if_not_else +help: try + | +1307 ~ if self.overflow { +1308 + self.line.clear(); +1309 + } else { +1310 + let bytes = std::mem::take(&mut self.line); +1311 + let line = String::from_utf8_lossy(&bytes); +1312 + if let Some(command) = world_command(&line) { +1313 + commands.push(command); +1314 + } +1315 + } + | + +warning: case-sensitive file extension comparison + --> src/world_ssh.rs:1400:5 + | +1400 | lower.ends_with(".md") || lower.ends_with(".markdown") || lower.en... + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider using a case-insensitive comparison instead + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#case_sensitive_file_extension_comparisons + = note: `-W clippy::case-sensitive-file-extension-comparisons` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::case_sensitive_file_extension_comparisons)]` +help: use std::path::Path + | +1400 ~ std::path::Path::new(&lower) +1401 + .extension() +1402 ~ .is_some_and(|ext| ext.eq_ignore_ascii_case("md")) || lower.ends_with(".markdown") || lower.ends_with(".txt") + | + +warning: case-sensitive file extension comparison + --> src/world_ssh.rs:1400:63 + | +1400 | ..._with(".markdown") || lower.ends_with(".txt") + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider using a case-insensitive comparison instead + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#case_sensitive_file_extension_comparisons +help: use std::path::Path + | +1400 ~ lower.ends_with(".md") || lower.ends_with(".markdown") || std::path::Path::new(&lower) +1401 + .extension() +1402 + .is_some_and(|ext| ext.eq_ignore_ascii_case("txt")) + | + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_ssh.rs:1465:18 + | +1465 | .map_err(|_| DocumentError::Unavailable)? + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: this could be rewritten as `let...else` + --> src/world_ssh.rs:1467:5 + | +1467 | / let size = match store.blobs().status(tag.hash).await { +1468 | | Ok(iroh_blobs::api::blobs::BlobStatus::Complete { size }) =>... +1469 | | _ => return Err(DocumentError::Unavailable), +1470 | | }; + | |______^ help: consider writing: `let Ok(iroh_blobs::api::blobs::BlobStatus::Complete { size }) = store.blobs().status(tag.hash).await else { return Err(DocumentError::Unavailable) };` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#manual_let_else + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_ssh.rs:1478:18 + | +1478 | .map_err(|_| DocumentError::Unavailable)?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_ssh.rs:1482:52 + | +1482 | let text = std::str::from_utf8(&bytes).map_err(|_| DocumentError::... + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: `to_string()` called on a `&str` + --> src/web/markdown.rs:140:17 + | +140 | return (markdown.to_string(), None); + | ^^^^^^^^^^^^^^^^^^^^ help: try: `markdown.to_owned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#str_to_string + +warning: `to_string()` called on a `&str` + --> src/web/markdown.rs:208:10 + | +208 | (markdown.to_string(), None) + | ^^^^^^^^^^^^^^^^^^^^ help: try: `markdown.to_owned()` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#str_to_string + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:754:18 + | +754 | /// True for the HtmlBlock comrak's renderer emits between adjacent + | ^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +754 - /// True for the HtmlBlock comrak's renderer emits between adjacent +754 + /// True for the `HtmlBlock` comrak's renderer emits between adjacent + | + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:755:16 + | +755 | /// lists (see collect_block_children). + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +755 - /// lists (see collect_block_children). +755 + /// lists (see `collect_block_children`). + | + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:763:47 + | +763 | /// Convert a comrak list node to one or more ProseMirror list nodes. + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +763 - /// Convert a comrak list node to one or more ProseMirror list nodes. +763 + /// Convert a comrak list node to one or more `ProseMirror` list nodes. + | + +error: calling `push_str()` using a single-character string literal + --> src/web/markdown.rs:1020:17 + | +1020 | out.push_str("\""); + | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push('"')` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_char_add_str + = note: `-D clippy::single-char-add-str` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::single_char_add_str)]` + +error: calling `push_str()` using a single-character string literal + --> src/web/markdown.rs:1037:17 + | +1037 | out.push_str("\""); + | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push('"')` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_char_add_str + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:1424:16 + | +1424 | /// subject to CommonMark flanking rules. Link (bracket syntax) and + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1424 - /// subject to CommonMark flanking rules. Link (bracket syntax) and +1424 + /// subject to `CommonMark` flanking rules. Link (bracket syntax) and + | + +warning: this could be a `const fn` + --> src/web/markdown.rs:1426:1 + | +1426 | / fn is_delimiter_wrapper(value: &NodeValue) -> bool { +1427 | | matches!( +1428 | | value, +1429 | | NodeValue::Emph | NodeValue::Strong | NodeValue::Strikethrough +1430 | | ) +1431 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +1426 | const fn is_delimiter_wrapper(value: &NodeValue) -> bool { + | +++++ + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:1603:5 + | +1603 | /// CommonMark flanking rules on reparse and the mark is destroyed. + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1603 - /// CommonMark flanking rules on reparse and the mark is destroyed. +1603 + /// `CommonMark` flanking rules on reparse and the mark is destroyed. + | + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/web/markdown.rs:1653:13 + | +1653 | *url = substitutions[index].0.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `url.clone_from(&substitutions[index].0)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: assigning the result of `Clone::clone()` may be inefficient + --> src/web/markdown.rs:1660:13 + | +1660 | *url = placeholder.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `url.clone_from(&placeholder)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#assigning_clones + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:1668:17 + | +1668 | /// Used by the footnote_definition save path (#1031) to tell carried + | ^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1668 - /// Used by the footnote_definition save path (#1031) to tell carried +1668 + /// Used by the `footnote_definition` save path (#1031) to tell carried + | + +warning: redundant closure + --> src/web/markdown.rs:1697:25 + | +1697 | .is_none_or(|marks| marks.is_empty()) + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::vec::Vec::is_empty` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_closure_for_method_calls + = note: `-W clippy::redundant-closure-for-method-calls` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_closure_for_method_calls)]` + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:1736:58 + | +1736 | /// Unmarked text runs are written verbatim on save, but CommonMark + | ^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +1736 - /// Unmarked text runs are written verbatim on save, but CommonMark +1736 + /// Unmarked text runs are written verbatim on save, but `CommonMark` + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1962:21 + | +1962 | ... tag.push_str(&format!(" alt=\"{}\"", escape_attr_value(alt))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1962 - tag.push_str(&format!(" alt=\"{}\"", escape_attr_value(alt))); +1962 + let _ = write!(tag, " alt=\"{}\"", escape_attr_value(alt)); + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1965:21 + | +1965 | ... tag.push_str(&format!(" title=\"{}\"", escape_attr_value(title))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1965 - tag.push_str(&format!(" title=\"{}\"", escape_attr_value(title))); +1965 + let _ = write!(tag, " title=\"{}\"", escape_attr_value(title)); + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1968:21 + | +1968 | tag.push_str(&format!(" width=\"{w}\"")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1968 - tag.push_str(&format!(" width=\"{w}\"")); +1968 + let _ = write!(tag, " width=\"{w}\""); + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1971:21 + | +1971 | tag.push_str(&format!(" height=\"{h}\"")); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1971 - tag.push_str(&format!(" height=\"{h}\"")); +1971 + let _ = write!(tag, " height=\"{h}\""); + | + +warning: `format!(..)` appended to existing `String` + --> src/web/markdown.rs:1985:25 + | +1985 | ... anchor.push_str(&format!(" title=\"{}\"", escape_attr_value(link_title))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_push_string +help: consider using `write!` to avoid the extra allocation + | +1985 - anchor.push_str(&format!(" title=\"{}\"", escape_attr_value(link_title))); +1985 + let _ = write!(anchor, " title=\"{}\"", escape_attr_value(link_title)); + | + +warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` + --> src/web/markdown.rs:2084:34 + | +2084 | let target = match paragraph { + | __________________________________^ +2085 | | Some(p) => p, +2086 | | None => { +... | +2096 | | }; + | |_____________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_match_else +help: try + | +2084 ~ let target = if let Some(p) = paragraph { p } else { +2085 + // `&*` reborrows the arena's `&mut` as a shared +2086 + // reference so `p` stays Copy-usable after +2087 + // being stored in `paragraph`. +2088 + let p: &'a AstNode<'a> = +2089 + &*arena.alloc(AstNode::from(NodeValue::Paragraph)); +2090 + ast_node.append(p); +2091 + paragraph = Some(p); +2092 + p +2093 ~ }; + | + +warning: this could be simplified with `bool::then_some` + --> src/web/markdown.rs:2132:32 + | +2132 | ...list = if is_bullet_list { Some(child) } else { None }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_bullet_list.then_some(child)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#if_then_some_else_none + = note: requested on the command line with `-W clippy::if-then-some-else-none` + +warning: this could be a `const fn` + --> src/web/markdown.rs:2208:1 + | +2208 | / fn valid_table_cell_child(value: &NodeValue) -> bool { +2209 | | matches!( +2210 | | value, +2211 | | NodeValue::Text(..) +... | +2232 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +2208 | const fn valid_table_cell_child(value: &NodeValue) -> bool { + | +++++ + +warning: this could be a `const fn` + --> src/web/markdown.rs:2304:1 + | +2304 | / fn is_mark_wrapper(value: &NodeValue) -> bool { +2305 | | matches!( +2306 | | value, +2307 | | NodeValue::Link(..) | NodeValue::Strong | NodeValue::Emph | ... +2308 | | ) +2309 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#missing_const_for_fn +help: make the function `const` + | +2304 | const fn is_mark_wrapper(value: &NodeValue) -> bool { + | +++++ + +warning: item in documentation is missing backticks + --> src/web/markdown.rs:2341:22 + | +2341 | /// (#968). Adjacent ProseMirror runs are converted one at a time, each + | ^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +2341 - /// (#968). Adjacent ProseMirror runs are converted one at a time, each +2341 + /// (#968). Adjacent `ProseMirror` runs are converted one at a time, each + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/web/routes.rs:224:29 + | +224 | || day > month_days[(month - 1) as usize] + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +224 - || day > month_days[(month - 1) as usize] +224 + || day > month_days[usize::try_from(month - 1)] + | + +error: the loop variable `m` is only used to index `month_days` + --> src/web/routes.rs:238:14 + | +238 | for m in 0..(month.saturating_sub(1) as usize) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_range_loop + = note: `-D clippy::needless-range-loop` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::needless_range_loop)]` +help: consider using an iterator + | +238 - for m in 0..(month.saturating_sub(1) as usize) { +238 + for in month_days.iter().take((month.saturating_sub(1) as usize)) { + | + +warning: redundant closure + --> src/web/routes.rs:333:61 + | +333 | ...ap_or_else(Vec::new, |hub| hub.list()); + | ^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `super::super::world_hub::WorldHub::list` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_closure_for_method_calls + +warning: item in documentation is missing backticks + --> src/web/routes.rs:927:14 + | +927 | /// Returns (paginated_items, clamped_page, clamped_per_page). + | ^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +927 - /// Returns (paginated_items, clamped_page, clamped_per_page). +927 + /// Returns (`paginated_items`, clamped_page, clamped_per_page). + | + +warning: item in documentation is missing backticks + --> src/web/routes.rs:927:31 + | +927 | /// Returns (paginated_items, clamped_page, clamped_per_page). + | ^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +927 - /// Returns (paginated_items, clamped_page, clamped_per_page). +927 + /// Returns (paginated_items, `clamped_page`, clamped_per_page). + | + +warning: item in documentation is missing backticks + --> src/web/routes.rs:927:45 + | +927 | /// Returns (paginated_items, clamped_page, clamped_per_page). + | ^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#doc_markdown +help: try + | +927 - /// Returns (paginated_items, clamped_page, clamped_per_page). +927 + /// Returns (paginated_items, clamped_page, `clamped_per_page`). + | + +warning: these match arms have identical bodies + --> src/web/routes.rs:2110:13 + | +2110 | ... "paragraph" | "heading" => lines.push(extract_inline_text(node)), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2111 | ... "code_block" => lines.push(extract_inline_text(node)), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is unintentional make the arms return different values + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#match_same_arms +help: otherwise merge the patterns into a single arm + | +2110 - "paragraph" | "heading" => lines.push(extract_inline_text(node)), +2111 - "code_block" => lines.push(extract_inline_text(node)), +2110 + "paragraph" | "heading" | "code_block" => lines.push(extract_inline_text(node)), + | + +error: this function has too many arguments (9/7) + --> src/web/mod.rs:303:1 + | +303 | / pub async fn web_router( +304 | | store: Store, +305 | | peers: Option, +306 | | node_id: String, +... | +312 | | cookie_secure: bool, +313 | | ) -> anyhow::Result { + | |___________________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#too_many_arguments + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:462:5 + | +462 | pub fn update(&mut self, participant: u64, event: &[u8]) -> Result<()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `update` defined here + --> src/sandbox.rs:836:5 + | +836 | fn update(&mut self, event: &crate::world::WorldEvent) -> Result<()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + = note: requested on the command line with `-W clippy::same-name-method` + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:507:5 + | +507 | pub fn view(&mut self) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `view` defined here + --> src/sandbox.rs:853:5 + | +853 | fn view(&mut self, _viewer: &crate::world::Participant) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:580:5 + | +580 | pub fn records(&mut self) -> Result>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `records` defined here + --> src/sandbox.rs:872:5 + | +872 | fn records(&mut self) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:610:5 + | +610 | pub fn wants(&mut self) -> Result>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `wants` defined here + --> src/sandbox.rs:878:5 + | +878 | fn wants(&mut self) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + +warning: method's name is the same as an existing method in a trait + --> src/sandbox.rs:641:5 + | +641 | pub fn snapshot(&mut self) -> Result>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: existing `snapshot` defined here + --> src/sandbox.rs:888:5 + | +888 | fn snapshot(&mut self) -> Result> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#same_name_method + +warning: unused `async` for function with no await statements + --> src/world/actor.rs:360:5 + | +360 | / async fn deliver(&mut self, text: String) -> bool { +361 | | if !self.program_healthy || self.storage_failed { +362 | | return false; +... | +394 | | journaled +395 | | } + | |_____^ + | + = help: consider removing the `async` from this function + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async + = note: `-W clippy::unused-async` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_async)]` + +warning: unused `async` for function with no await statements + --> src/world/actor.rs:1398:5 + | +1398 | / async fn compact_if_due(&mut self) { +1399 | | if self.compaction_off +1400 | | || self.storage_failed +1401 | | || !self.program_healthy +... | +1420 | | } + | |_____^ + | + = help: consider removing the `async` from this function + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async + +warning: this parameter is a mutable reference but is not used mutably + --> src/world/actor.rs:352:20 + | +352 | fn republished(&mut self, records: Records, sequence: u64) { + | ^----^^^^ + | | + | help: consider removing this `mut` + | + = note: this is cfg-gated and may require further changes + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_ref_mut + = note: `-W clippy::needless-pass-by-ref-mut` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::needless_pass_by_ref_mut)]` + +warning: `id` (lib) generated 248 warnings +error: could not compile `id` (lib) due to 26 previous errors; 248 warnings emitted +warning: build failed, waiting for other jobs to finish... +warning: function `lobby_with_bo` is never used + --> src/web/explore.rs:673:14 + | +673 | async fn lobby_with_bo() -> (Router, String) { + | ^^^^^^^^^^^^^ + +warning: function `test_footnote_roundtrip_fixpoint` is never used + --> src/web/markdown.rs:3440:8 + | +3440 | fn test_footnote_roundtrip_fixpoint() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: large future with a size of 22248 bytes + --> src/connectivity.rs:389:9 + | +389 | / within( +390 | | Duration::from_secs(240), +391 | | "running the N0 dial test", +392 | | async { +... | +434 | | }, +435 | | ) + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#large_futures + = note: `-W clippy::large-futures` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::large_futures)]` +help: consider `Box::pin` on it + | +389 ~ Box::pin(within( +390 + Duration::from_secs(240), +391 + "running the N0 dial test", +392 + async { +393 + let server = public_builder(RelayPolicy::N0) +394 + .alpns(vec![TEST_ALPN.to_vec()]) +395 + .bind() +396 + .await?; +397 + let client = public_builder(RelayPolicy::N0).bind().await?; +398 + // Wait for a home relay on both sides. The server publishes its +399 + // address once the relay is known, so an early lookup can miss it. +400 + server.online().await; +401 + client.online().await; +402 + let server_id = server.id(); +403 + +404 + let accepting = tokio::spawn({ +405 + let server = server.clone(); +406 + async move { +407 + let incoming = server.accept().await.context("server closed")?; +408 + anyhow::Ok(incoming.await?) +409 + } +410 + }); +411 + let mut attempt = 1; +412 + let conn = loop { +413 + match connect(&client, server_id, TEST_ALPN).await { +414 + Ok(conn) => break conn, +415 + Err(err) if attempt < 3 => { +416 + eprintln!("dial attempt {attempt} failed, retrying: {err:#}"); +417 + attempt += 1; +418 + tokio::time::sleep(Duration::from_secs(2)).await; +419 + } +420 + Err(err) => return Err(err), +421 + } +422 + }; +423 + anyhow::ensure!(conn.remote_id() == server_id, "dialed a different endpoint"); +424 + let accepted = accepting.await??; +425 + anyhow::ensure!( +426 + accepted.remote_id() == client.id(), +427 + "accepted from a different endpoint" +428 + ); +429 + +430 + conn.close(0u32.into(), b"done"); +431 + client.close().await; +432 + server.close().await; +433 + anyhow::Ok(()) +434 + }, +435 + )) + | + +warning: use of `format!` to build up a string from an iterator + --> src/directory.rs:2051:28 + | +2051 | let kept: String = text + | ____________________________^ +2052 | | .lines() +2053 | | .rev() +2054 | | .skip(1) +... | +2058 | | .map(|line| format!("{line}\n")) +2059 | | .collect(); + | |______________________^ + | +help: call `fold` instead + --> src/directory.rs:2058:14 + | +2058 | .map(|line| format!("{line}\n")) + | ^^^ +help: ... and use the `write!` macro here + --> src/directory.rs:2058:25 + | +2058 | .map(|line| format!("{line}\n")) + | ^^^^^^^^^^^^^^^^^^^ + = note: this can be written more efficiently by appending to a `String` directly + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_collect + = note: `-W clippy::format-collect` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::format_collect)]` + +error: called `.err().expect()` on a `Result` value + --> src/directory.rs:2716:14 + | +2716 | .err() + | ______________^ +2717 | | .expect("corrupt line must fail"); + | |___________________^ help: try: `expect_err` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#err_expect + = note: `-D clippy::err-expect` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::err_expect)]` + +error: very complex type used. Consider factoring parts into `type` definitions + --> src/event_store/ingest.rs:1142:36 + | +1142 | ...ventStore) -> (Vec>, Vec<(Vec, Vec)>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#type_complexity + = note: `-D clippy::type-complexity` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::type_complexity)]` + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/ingest.rs:2583:24 + | +2583 | for seq in 0..=(rng.below(3) as SeqNum) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation + = note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic` + = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]` +help: ... or use `try_from` and handle the error accordingly + | +2583 - for seq in 0..=(rng.below(3) as SeqNum) { +2583 + for seq in 0..=SeqNum::try_from(rng.below(3)) { + | + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/ingest.rs:2592:28 + | +2592 | for seq in 0..=(rng.below(3) as SeqNum) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2592 - for seq in 0..=(rng.below(3) as SeqNum) { +2592 + for seq in 0..=SeqNum::try_from(rng.below(3)) { + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2595:33 + | +2595 | let named = rng.below(anchor.len() as u64) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2595 - let named = rng.below(anchor.len() as u64) as usize; +2595 + let named = usize::try_from(rng.below(anchor.len() as u64)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2607:23 + | +2607 | let who = rng.below(3) as usize; + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2607 - let who = rng.below(3) as usize; +2607 + let who = usize::try_from(rng.below(3)); + | + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/ingest.rs:2609:23 + | +2609 | let seq = rng.below(chain.len() as u64) as SeqNum; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2609 - let seq = rng.below(chain.len() as u64) as SeqNum; +2609 + let seq = SeqNum::try_from(rng.below(chain.len() as u64)); + | + +warning: casting `usize` to `u8` may truncate the value + --> src/event_store/ingest.rs:2611:41 + | +2611 | ... let rival = event(&key(20 + who as u8), seq, backlink, Vec::new(... + | ^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2611 - let rival = event(&key(20 + who as u8), seq, backlink, Vec::new(), "rival"); +2611 + let rival = event(&key(20 + u8::try_from(who)), seq, backlink, Vec::new(), "rival"); + | + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/ingest.rs:2616:24 + | +2616 | for seq in 0..=(rng.below(3) as SeqNum) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2616 - for seq in 0..=(rng.below(3) as SeqNum) { +2616 + for seq in 0..=SeqNum::try_from(rng.below(3)) { + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2618:26 + | +2618 | let target = rng.below(all.len() as u64) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2618 - let target = rng.below(all.len() as u64) as usize; +2618 + let target = usize::try_from(rng.below(all.len() as u64)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2624:28 + | +2624 | let copy = all[rng.below(all.len() as u64) as usize].clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2624 - let copy = all[rng.below(all.len() as u64) as usize].clone(); +2624 + let copy = all[usize::try_from(rng.below(all.len() as u64))].clone(); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2628:21 + | +2628 | let j = rng.below(i as u64 + 1) as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2628 - let j = rng.below(i as u64 + 1) as usize; +2628 + let j = usize::try_from(rng.below(i as u64 + 1)); + | + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/event_store/ingest.rs:2670:33 + | +2670 | let take = (1 + rng.below(6) as usize).min(rest.len()); + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +2670 - let take = (1 + rng.below(6) as usize).min(rest.len()); +2670 + let take = (1 + usize::try_from(rng.below(6))).min(rest.len()); + | + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> src/event_store/range.rs:277:15 + | +277 | (out, (hi - lo) as u32) + | ^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +277 - (out, (hi - lo) as u32) +277 + (out, u32::try_from(hi - lo)) + | + +warning: use of `format!` to build up a string from an iterator + --> src/event_store/range.rs:807:9 + | +807 | bytes.iter().map(|b| format!("{b:02x}")).collect() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: call `fold` instead + --> src/event_store/range.rs:807:22 + | +807 | bytes.iter().map(|b| format!("{b:02x}")).collect() + | ^^^ +help: ... and use the `write!` macro here + --> src/event_store/range.rs:807:30 + | +807 | bytes.iter().map(|b| format!("{b:02x}")).collect() + | ^^^^^^^^^^^^^^^^^^ + = note: this can be written more efficiently by appending to a `String` directly + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_collect + +error: unnecessary use of `clone` to create a slice from a reference + --> src/event_store/range.rs:899:38 + | +899 | ...spond(&[root.clone()], Params::new(2, 40).unwrap(), &mut learned); + | ^^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&root)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cloned_ref_to_slice_refs + = note: `-D clippy::cloned-ref-to-slice-refs` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::cloned_ref_to_slice_refs)]` + +error: unnecessary use of `clone` to create a slice from a reference + --> src/event_store/range.rs:906:39 + | +906 | ...spond(&[root.clone()], Params::new(4, 39).unwrap(), &mut learned); + | ^^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&root)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cloned_ref_to_slice_refs + +error: unnecessary use of `clone` to create a slice from a reference + --> src/event_store/range.rs:910:40 + | +910 | ...spond(&[root.clone()], Params::new(2, 1).unwrap(), &mut learned); + | ^^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&root)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cloned_ref_to_slice_refs + +error: very complex type used. Consider factoring parts into `type` definitions + --> src/event_store/sync.rs:911:30 + | +911 | fn lengths(seed: u32) -> (Vec<(u64, u32)>, Vec<(u64, u32)>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#type_complexity + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/sync.rs:913:27 + | +913 | .map(|c| (c, (c as u32 * (7 + seed)) % 19)) + | ^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +913 - .map(|c| (c, (c as u32 * (7 + seed)) % 19)) +913 + .map(|c| (c, (u32::try_from(c) * (7 + seed)) % 19)) + | + +warning: casting `u64` to `u32` may truncate the value + --> src/event_store/sync.rs:916:27 + | +916 | .map(|c| (c, (c as u32 * (5 + seed) + 3) % 23)) + | ^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +916 - .map(|c| (c, (c as u32 * (5 + seed) + 3) % 23)) +916 + .map(|c| (c, (u32::try_from(c) * (5 + seed) + 3) % 23)) + | + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> src/event_store/sync.rs:932:36 + | +932 | let (la, lb) = lengths(seed as u32); + | ^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +932 - let (la, lb) = lengths(seed as u32); +932 + let (la, lb) = lengths(u32::try_from(seed)); + | + +warning: using `.clone()` on a ref-counted pointer + --> src/event_sync.rs:241:50 + | +241 | .accept(ALPN, EventSyncProtocol::new(b.clone())) + | ^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&b)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + = note: requested on the command line with `-W clippy::clone-on-ref-ptr` + +warning: using `.clone()` on a ref-counted pointer + --> src/event_sync.rs:280:50 + | +280 | .accept(ALPN, EventSyncProtocol::new(b.clone())) + | ^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&b)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: redundant clone + --> src/groups/worlds.rs:553:45 + | +553 | let mut reversed = ledger.events.clone(); + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> src/groups/worlds.rs:553:32 + | +553 | let mut reversed = ledger.events.clone(); + | ^^^^^^^^^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + = note: `-W clippy::redundant-clone` implied by `-W clippy::nursery` + = help: to override `-W clippy::nursery` add `#[allow(clippy::redundant_clone)]` + +warning: casting `usize` to `u8` may truncate the value + --> src/log_sync.rs:961:50 + | +961 | tx.try_send(Arrival::Header(vec![n as u8])).unwrap(); + | ^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +961 - tx.try_send(Arrival::Header(vec![n as u8])).unwrap(); +961 + tx.try_send(Arrival::Header(vec![u8::try_from(n)])).unwrap(); + | + +warning: casting `usize` to `u8` may truncate the value + --> src/log_sync.rs:1007:46 + | +1007 | tx.try_send(Arrival::Header(vec![(n % 251) as u8])).unwrap(); + | ^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +1007 - tx.try_send(Arrival::Header(vec![(n % 251) as u8])).unwrap(); +1007 + tx.try_send(Arrival::Header(vec![u8::try_from(n % 251)])).unwrap(); + | + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/log_sync.rs:1075:9 + | +1075 | const REFUSALS: usize = BATCH_MAX_ARRIVALS + 10; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers + --> src/log_sync.rs:1087:35 + | +1087 | ... assert_eq!(tally.refused, REFUSALS as u32, "every refusal is tal... + | ^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +1087 - assert_eq!(tally.refused, REFUSALS as u32, "every refusal is tallied"); +1087 + assert_eq!(tally.refused, u32::try_from(REFUSALS), "every refusal is tallied"); + | + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1171:9 + | +1171 | / fn wants_of(chat: &mut WorldInstance) -> String { +1172 | | crate::world::WorldProgram::wants(chat).unwrap().unwrap() +1173 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1174:9 + | +1174 | / fn send(chat: &mut WorldInstance, ev: &[u8]) { +1175 | | crate::world::WorldProgram::update( +1176 | | chat, +1177 | | &WorldEvent { +... | +1183 | | .unwrap(); +1184 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1185:9 + | +1185 | / fn host(chat: &mut WorldInstance, event: serde_json::Value) { +1186 | | crate::world::WorldProgram::update( +1187 | | chat, +1188 | | &WorldEvent { +... | +1196 | | .unwrap(); +1197 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1198:9 + | +1198 | / fn view(chat: &mut WorldInstance) -> String { +1199 | | String::from_utf8(chat.view().unwrap()).unwrap() +1200 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +warning: this argument is passed by value, but not consumed in the function body + --> src/sandbox.rs:1185:50 + | +1185 | fn host(chat: &mut WorldInstance, event: serde_json::Value) { + | ^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +1185 | fn host(chat: &mut WorldInstance, event: &serde_json::Value) { + | + + +warning: adding items after statements is confusing, since items exist from the start of the scope + --> src/sandbox.rs:1482:9 + | +1482 | / fn wants_of(lounge: &mut WorldInstance) -> String { +1483 | | crate::world::WorldProgram::wants(lounge) +1484 | | .unwrap() +1485 | | .context("the lounge exports wants") +1486 | | .unwrap() +1487 | | } + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#items_after_statements + +error: very complex type used. Consider factoring parts into `type` definitions + --> src/search.rs:106:22 + | +106 | ...d: Vec<(BTreeSet<[u8; 32]>, BTreeMap<[u8; 32], BTreeSet<[u8; 32]>>)> = + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#type_complexity + +warning: using `.clone()` on a ref-counted pointer + --> src/world/actor.rs:620:23 + | +620 | let records = self.records_sender.borrow().1.clone(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&self.records_sender.borrow().1)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` + --> src/world/actor.rs:1437:23 + | +1437 | let initial = match program_records(program.as_mut()) { + | _______________________^ +1438 | | Ok(records) => records.unwrap_or_default(), +1439 | | Err(_) => { +1440 | | program_healthy = false; +... | +1443 | | }; + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_match_else +help: try + | +1437 ~ let initial = if let Ok(records) = program_records(program.as_mut()) { records.unwrap_or_default() } else { +1438 + program_healthy = false; +1439 + Records::new() +1440 ~ }; + | + +error: module has the same name as its containing module + --> src/world/tests.rs:7:1 + | + 7 | / mod tests { + 8 | | use super::*; + 9 | | + 10 | | fn world(retained_events: usize) -> WorldCore { +... | +2498 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#module_inception + = note: `-D clippy::module-inception` implied by `-D clippy::all` + = help: to override `-D clippy::all` add `#[allow(clippy::module_inception)]` + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:685:72 + | +685 | ...ldLimits::default(), clock.clone()).unwrap(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:731:72 + | +731 | ...ldLimits::default(), clock.clone()).unwrap(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:802:83 + | +802 | ...ldLimits::default(), clock.clone()) + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:1039:80 + | +1039 | ...ldLimits::default(), clock.clone()) + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:3259:67 + | +3259 | ...ldLimits::default(), clock.clone()).unwrap(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:3291:9 + | +3291 | actor.records_sender.borrow().1.clone() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::sync::Arc::>::clone(&actor.records_sender.borrow().1)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:3609:22 + | +3609 | core.clock = clock.clone(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: using `.clone()` on a ref-counted pointer + --> src/world/tests.rs:3644:22 + | +3644 | core.clock = clock.clone(); + | ^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&clock)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: calling `std::fs::create_dir` where there may be a better way + --> src/world_compile.rs:697:9 + | +697 | std::fs::create_dir(root.path().join("empty")).unwrap(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#create_dir + = note: requested on the command line with `-W clippy::create-dir` +help: consider calling `std::fs::create_dir_all` instead + | +697 | std::fs::create_dir_all(root.path().join("empty")).unwrap(); + | ++++ + +warning: using `.clone()` on a ref-counted pointer + --> src/world_hub.rs:831:44 + | +831 | let opener: Arc = opener.clone(); + | ^^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(opener)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: used underscore-prefixed binding + --> src/world_hub.rs:1167:14 + | +1167 | drop(_b); + | ^^ + | +note: binding is defined here + --> src/world_hub.rs:1153:13 + | +1153 | let _b = hub.lease(Some("b"), Some("admin")).await.unwrap(); + | ^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#used_underscore_binding + +warning: redundant clone + --> src/world_manifest.rs:665:32 + | +665 | let mut applied = state.clone(); + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> src/world_manifest.rs:665:27 + | +665 | let mut applied = state.clone(); + | ^^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: `map_err(|_|...` wildcard pattern discards the original error + --> src/world_native.rs:995:26 + | +995 | .map_err(|_| "worker gone".to_owned())?; + | ^^^ + | + = help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_err_ignore + +warning: using `.clone()` on a ref-counted pointer + --> src/world_net.rs:1777:66 + | +1777 | ..._hub::WorldOpener> = opener.clone(); + | ^^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&opener)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: this argument is passed by value, but not consumed in the function body + --> src/world_presentation.rs:519:22 + | +519 | fn screen(value: Value) -> Result> { + | ^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +519 | fn screen(value: &Value) -> Result> { + | + + +error: module has the same name as its containing module + --> src/world_session/tests.rs:2:1 + | + 2 | / mod tests { + 3 | | use tokio::sync::mpsc; + 4 | | + 5 | | use ed25519_dalek::SigningKey; +... | +1842 | | } + | |_^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#module_inception + +warning: using `.clone()` on a ref-counted pointer + --> src/world_session/tests.rs:1215:66 + | +1215 | ..._hub::WorldOpener> = opener.clone(); + | ^^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&opener)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: unused `async` for async trait impl function with no `.await` statements + --> src/world_ssh.rs:1766:9 + | +1766 | / async fn check_server_key( +1767 | | &mut self, +1768 | | _key: &russh::keys::PublicKeyOrCertificate, +1769 | | ) -> Result { +1770 | | Ok(true) +1771 | | } + | |_________^ + | + = note: `std::future::ready` creates a `Future` which returns the value immediately when `poll`ed + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#unused_async_trait_impl +help: consider removing the `async` from this function and returning `impl Future>` instead + | +1766 ~ fn check_server_key( +1767 | &mut self, +1768 | _key: &russh::keys::PublicKeyOrCertificate, +1769 ~ ) -> impl Future> { +1770 ~ std::future::ready(Ok(true)) + | + +error: this `if` statement can be collapsed + --> src/world_ssh.rs:2353:17 + | +2353 | / ... if let Ok(event) = events.recv().await { +2354 | | ... if matches!(event.kind, crate::world::WorldEventKind::Chat... +2355 | | ... break; +2356 | | ... } +2357 | | ... } + | |_______^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#collapsible_if +help: collapse nested if block + | +2353 ~ if let Ok(event) = events.recv().await +2354 ~ && matches!(event.kind, crate::world::WorldEventKind::Chat { .. }) { +2355 | break; +2356 ~ } + | + +warning: called `map().unwrap_or_else()` on a `Result` value + --> src/world_ssh.rs:2795:13 + | +2795 | / contract +2796 | | .check_client_frame(&value, phase) +2797 | | .map(str::to_owned) +2798 | | .unwrap_or_else(|error| panic!("{frame}: {error}")) + | |___________________________________________________________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or +help: try + | +2795 ~ contract +2796 + .check_client_frame(&value, phase).map_or_else(|error| panic!("{frame}: {error}"), str::to_owned) + | + +warning: consider adding a `;` to the last statement for consistent formatting + --> src/world_ssh.rs:2966:17 + | +2966 | const { assert!( + | _________________^ +2967 | | MAX_RECORDS_TOTAL_BYTES > MAX_RECORDS_TERMINAL_BYTES, +2968 | | "the total cap must exceed the per-page cap" +2969 | | ) }; + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#semicolon_if_nothing_returned +help: add a `;` here + | +2966 | const { assert!( +2967 | MAX_RECORDS_TOTAL_BYTES > MAX_RECORDS_TERMINAL_BYTES, +2968 | "the total cap must exceed the per-page cap" +2969 ~ ); }; + | + +warning: consider adding a `;` to the last statement for consistent formatting + --> src/world_ssh.rs:2970:17 + | +2970 | const { assert!( + | _________________^ +2971 | | MAX_RECORDS_TOTAL_BYTES < usize::MAX / 4, +2972 | | "the total cap must be finite" +2973 | | ) }; + | |_________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#semicolon_if_nothing_returned +help: add a `;` here + | +2970 | const { assert!( +2971 | MAX_RECORDS_TOTAL_BYTES < usize::MAX / 4, +2972 | "the total cap must be finite" +2973 ~ ); }; + | + +warning: redundant clone + --> src/world_store.rs:1073:29 + | +1073 | let mut newer = good.clone(); + | ^^^^^^^^ help: remove this + | +note: this value is dropped without further use + --> src/world_store.rs:1073:25 + | +1073 | let mut newer = good.clone(); + | ^^^^ + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_clone + +warning: use of `format!` to build up a string from an iterator + --> src/world_store.rs:1612:28 + | +1612 | ... let text: String = legacy + | __________________________^ +1613 | | ... .iter() +1614 | | ... .map(|entry| format!("{}\n", serde_json::to_string(entry).... +1615 | | ... .collect(); + | |____________________^ + | +help: call `fold` instead + --> src/world_store.rs:1614:14 + | +1614 | ... .map(|entry| format!("{}\n", serde_json::to_string(entry).unwrap... + | ^^^ +help: ... and use the `write!` macro here + --> src/world_store.rs:1614:26 + | +1614 | ...ntry| format!("{}\n", serde_json::to_string(entry).unwrap())) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this can be written more efficiently by appending to a `String` directly + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#format_collect + +warning: using `.clone()` on a ref-counted pointer + --> src/web/home.rs:294:13 + | +294 | tags.clone(), + | ^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&tags)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: this argument is passed by value, but not consumed in the function body + --> src/web/markdown.rs:4585:42 + | +4585 | fn table_doc_with_cell(cell_content: Value) -> Value { + | ^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value +help: consider taking a reference instead + | +4585 | fn table_doc_with_cell(cell_content: &Value) -> Value { + | + + +warning: called `map().unwrap_or_else()` on an `Option` value + --> src/web/routes.rs:2639:13 + | +2639 | / images +2640 | | .iter() +2641 | | .find(|entry| entry["name"] == name) +2642 | | .map(|entry| entry["hash"].as_str().unwrap().to_owned()) +2643 | | .unwrap_or_else(|| panic!("{name} listed in {images:?}")) + | |_________________________________________________________________________^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#map_unwrap_or +help: try + | +2639 ~ images +2640 + .iter() +2641 + .find(|entry| entry["name"] == name).map_or_else(|| panic!("{name} listed in {images:?}"), |entry| entry["hash"].as_str().unwrap().to_owned()) + | + +warning: this argument is passed by value, but not consumed in the function body + --> src/web/routes.rs:3024:27 + | +3024 | fn plain_doc(content: Vec) -> serde_json::Value { + | ^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type to: `&[serde_json::Value]` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#needless_pass_by_value + +warning: you added something to a string. Consider using `String::push_str()` instead + --> src/web/routes.rs:3365:29 + | +3365 | let long_filename = "a".repeat(251) + ".png"; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#string_add + = note: requested on the command line with `-W clippy::string-add` + +warning: using `.clone()` on a ref-counted pointer + --> src/web/world_ws.rs:939:77 + | +939 | ..._hub::WorldOpener> = opener.clone(); + | ^^^^^^^^^^^^^^ help: try: `std::sync::Arc::::clone(&opener)` + | + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#clone_on_ref_ptr + +warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers + --> src/web/world_ws.rs:1098:27 + | +1098 | ...k_bytes = ready["chunk_bytes"].as_u64().unwrap() as usize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... + = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#cast_possible_truncation +help: ... or use `try_from` and handle the error accordingly + | +1098 - let chunk_bytes = ready["chunk_bytes"].as_u64().unwrap() as usize; +1098 + let chunk_bytes = usize::try_from(ready["chunk_bytes"].as_u64().unwrap()); + | + +warning: `id` (lib test) generated 339 warnings (245 duplicates) +error: could not compile `id` (lib test) due to 35 previous errors; 339 warnings emitted diff --git a/pkgs/id/src/tags.rs b/pkgs/id/src/tags.rs index 0cddc2d276..a1787558a1 100644 --- a/pkgs/id/src/tags.rs +++ b/pkgs/id/src/tags.rs @@ -1481,7 +1481,7 @@ pub fn parse_search_query(input: &str) -> Vec { // Skip whitespace: any `char::is_whitespace` char separates terms, // not only the ASCII space. while i < input.len() { - let ch = input[i..].chars().next().expect("i is a char boundary"); + let Some(ch) = input[i..].chars().next() else { break; }; if !ch.is_whitespace() { break; } @@ -1496,7 +1496,7 @@ pub fn parse_search_query(input: &str) -> Vec { let start = i; let mut in_quotes = false; while i < input.len() { - let ch = input[i..].chars().next().expect("i is a char boundary"); + let Some(ch) = input[i..].chars().next() else { break; }; if ch == '"' { in_quotes = !in_quotes; i += 1; diff --git a/pkgs/id/src/web/routes.rs b/pkgs/id/src/web/routes.rs index 5108f5f5d6..1220619347 100644 --- a/pkgs/id/src/web/routes.rs +++ b/pkgs/id/src/web/routes.rs @@ -3375,7 +3375,7 @@ mod tests { ); // …while the router-wide limit for the other routes stays at 10 MiB. assert_eq!(DEFAULT_BODY_LIMIT, 10 * 1024 * 1024); - assert!(UPLOAD_BODY_LIMIT > DEFAULT_BODY_LIMIT); + const { assert!(UPLOAD_BODY_LIMIT > DEFAULT_BODY_LIMIT) }; } #[test] diff --git a/pkgs/id/src/world_ssh.rs b/pkgs/id/src/world_ssh.rs index c194c53227..2dc8cdbd40 100644 --- a/pkgs/id/src/world_ssh.rs +++ b/pkgs/id/src/world_ssh.rs @@ -2963,14 +2963,14 @@ mod tests { ); // ...and the whole drain has a larger, but still finite, total cap, so // a many-page world stops instead of streaming without bound. - assert!( + const { assert!( MAX_RECORDS_TOTAL_BYTES > MAX_RECORDS_TERMINAL_BYTES, "the total cap must exceed the per-page cap" - ); - assert!( + ) }; + const { assert!( MAX_RECORDS_TOTAL_BYTES < usize::MAX / 4, "the total cap must be finite" - ); + ) }; } #[cfg(test)] diff --git a/pkgs/id/src/world_store.rs b/pkgs/id/src/world_store.rs index 7d9d7e28a0..4135205a3b 100644 --- a/pkgs/id/src/world_store.rs +++ b/pkgs/id/src/world_store.rs @@ -1563,7 +1563,7 @@ mod tests { )); journal .append(&JournalEntry::ExecutionProfile { - profile: profile.clone(), + profile, }) .unwrap(); } diff --git a/plan.md b/plan.md new file mode 100644 index 0000000000..4841d4a937 --- /dev/null +++ b/plan.md @@ -0,0 +1,21 @@ +Oh! The CI uses `1.99.0` (which must be a nightly or a specific beta/nightly named that way, or it's a mocked version for testing), whereas my local run used `1.73.0-nightly`! +That explains why I get 35 errors and the CI only got 2! +But wait, if the CI only got 2 errors, and I FIXED those 2 errors... +Then why did the second CI run in the prompt also fail with: +`error: could not compile id (lib test) due to 2 previous errors; 366 warnings emitted` ? +Wait... did my commit `style(id): resolve clippy-lint check failures in CI` actually push before the second CI run started? +Wait, if we look at the commit history in the prompt: +The first check run (which failed) had a URL `40977622764/job/123809622308`. +The second check run (which failed) had a URL `40980231415/job/123818485793`. +The third check run (which failed) had a URL `40980231415/job/123832861148`. +Notice that `40977622764` is run 1. `40980231415` is run 2. +Run 2 failed with exactly the same error! +Did my commit get included in Run 2? +If my commit was `ci: fix FlakeHub registration required error in actions cache`, that commit DID NOT FIX the clippy lint failures! +It only fixed the FlakeHub error! +So Run 2 (which I am seeing now) failed because of the clippy-lint failures, which I FIXED in my local repository BUT DID NOT SUBMIT YET! +Oh! I submitted `ci: disable FlakeHub in DeterminateSystems/magic-nix-cache-action`, which triggered Run 2. And Run 2 failed because I hadn't fixed the clippy-lint errors in that commit! +Then I fixed the clippy lint errors in a local commit `style(id): resolve clippy-lint check failures in CI`, but I haven't run `submit` to push them yet! +Ah! The user asked me to fix the failures from Run 2! +All I need to do is `submit` the changes I have already committed locally! +Let's verify what I have committed locally.