Skip to content

chore: bump rust toolchain to 1.95.0#6935

Merged
hanabi1224 merged 2 commits intomainfrom
hm/rust-1.95
Apr 20, 2026
Merged

chore: bump rust toolchain to 1.95.0#6935
hanabi1224 merged 2 commits intomainfrom
hm/rust-1.95

Conversation

@hanabi1224
Copy link
Copy Markdown
Contributor

@hanabi1224 hanabi1224 commented Apr 19, 2026

Summary of changes

Changes introduced in this pull request:

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   --> src/cli/subcommands/net_cmd.rs:79:34
    |
 79 | ...                   .zip(agents.into_iter()),
    |                            ^^^^^^^^^^^^^^^^^^
    |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`


warning: iterating on a map's values
   --> src/db/memory.rs:117:20
    |
117 |           let cids = self
    |  ____________________^
118 | |             .eth_mappings_db
119 | |             .read()
120 | |             .iter()
121 | |             .filter_map(|(_, value)| fvm_ipld_encoding::from_slice::<(Cid, u64)>(value).ok())
    | |_____________________________________________________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#iter_kv_map
    = note: `#[warn(clippy::iter_kv_map)]` on by default
	
	
warning: this `if` can be collapsed into the outer `match`
   --> src/db/gc/snapshot.rs:282:17
    |
282 | /                 if !map.is_empty() {
283 | |                     *self.memory_db.write() = Some(map);
284 | |                     *self.memory_db_head_key.write() = current_chain_head;
285 | |                 }
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#collapsible_match
    = note: `#[warn(clippy::collapsible_match)]` on by default
	
	
warning: this `if` can be collapsed into the outer `match`
   --> src/libp2p/discovery.rs:369:17
    |
369 | /                 if e.other_established == 0 {
370 | |                     self.n_node_connected += 1;
371 | |                     self.peers.insert(e.peer_id);
372 | |                     self.pending_events
373 | |                         .push_back(DiscoveryEvent::PeerConnected(e.peer_id));
374 | |                 }
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#collapsible_match
	
warning: casting to the same type is unnecessary (`usize` -> `usize`)
   --> src/eth/transaction.rs:639:41
    |
639 |         let mut eip_155_sig = vec![0u8; eip_155_sig_len as usize - v.len()];
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `eip_155_sig_len`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unnecessary_cast
    = note: `#[warn(clippy::unnecessary_cast)]` on by default
	
	
warning: manual checked division
  --> src/tool/subcommands/net_cmd.rs:48:20
   |
48 |                 if n_success > 0 {
   |                    ^^^^^^^^^^^^^ check performed here
49 |                     let avg_ms = total_duration.as_millis() / n_success;
   |                                  -------------------------------------- division performed here
   |
   = help: consider using `checked_div`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#manual_checked_ops
   = note: `#[warn(clippy::manual_checked_ops)]` on by default
   
   
warning: unneeded unit return type
   --> src/lotus_json/ipld.rs:279:25
    |
279 | fn quickcheck(val: Ipld) -> () {
    |                         ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unused_unit
    = note: `#[warn(clippy::unused_unit)]` on by default

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Chores

    • Updated Rust toolchain to 1.95.0.
    • Migrated test harness usage to the newer attribute-based test macros.
  • Refactor

    • Simplified iterator and consumption patterns and tightened control-flow with guard patterns.
    • Minor control-flow adjustments in async/result handling.
  • Bug Fixes

    • Added overflow-safe arithmetic to prevent division/overflow edge cases in progress and latency reporting.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 27d26b18-705d-4673-b9de-bad60673dbfa

📥 Commits

Reviewing files that changed from the base of the PR and between 3149b2c and a432ad4.

📒 Files selected for processing (1)
  • src/utils/net/download_file.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/utils/net/download_file.rs

Walkthrough

Updated Rust toolchain to 1.95.0; migrated many tests from quickcheck! macro to #[quickcheck_macros::quickcheck]; and applied small iterator, pattern, and overflow-safety refinements across several modules.

Changes

Cohort / File(s) Summary
Toolchain Update
rust-toolchain.toml
Bumped Rust toolchain version from 1.94.0 to 1.95.0.
Quickcheck Macro Migration (tests)
src/blocks/tipset.rs, src/cid_collections/hash_map.rs, src/cid_collections/mod.rs, src/cli/humantoken.rs, src/db/car/forest/index/hash.rs, src/db/car/forest/index/mod.rs, src/lotus_json/ipld.rs, src/lotus_json/mod.rs, src/lotus_json/opt.rs, src/lotus_json/raw_bytes.rs, src/lotus_json/vec.rs, src/rpc/methods/chain.rs
Replaced quickcheck::quickcheck! macro blocks with #[quickcheck_macros::quickcheck] attribute functions; removed explicit -> () return annotations and adjusted imports accordingly.
Iterator / Pattern Simplifications
src/cli/subcommands/net_cmd.rs, src/db/memory.rs, src/state_manager/mod.rs, src/db/gc/snapshot.rs, src/libp2p/discovery.rs
Simplified iterator usage (e.g., use .values() or zip(receipts)), converted nested if to match/guard patterns, and tightened branching to avoid unnecessary moves.
Arithmetic Safety & Minor Fixes
src/tool/subcommands/net_cmd.rs, src/utils/net/download_file.rs, src/eth/transaction.rs
Made divisions overflow-safe using checked_div/checked ops and removed a redundant cast; small test-only adjustment for signature padding length.
Other small refactors
src/cli/subcommands/net_cmd.rs (other minor iterator simplification)
Minor iterator-expression simplification in peer-to-agent mapping.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • akaladarshi
  • LesnyRumcajs
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: bump rust toolchain to 1.95.0' directly matches the primary change in the PR: updating the Rust toolchain version in rust-toolchain.toml from 1.94.0 to 1.95.0, with all other changes being downstream Clippy warning fixes resulting from the upgrade.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hm/rust-1.95
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch hm/rust-1.95

Comment @coderabbitai help to get the list of available commands and usage tips.

@hanabi1224 hanabi1224 marked this pull request as ready for review April 19, 2026 23:36
@hanabi1224 hanabi1224 requested a review from a team as a code owner April 19, 2026 23:36
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and akaladarshi and removed request for a team April 19, 2026 23:36
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/utils/net/download_file.rs`:
- Line 383: The percent calculation currently does multiplication then
checked_div which risks overflow; update the computation of percent (using the
downloaded and total_size variables where percent is assigned) to first use
checked_mul(100) and then checked_div(total_size), preserving the final
unwrap_or(0) fallback so division-by-zero and overflow are both handled safely
(e.g., downloaded.checked_mul(100).and_then(|v|
v.checked_div(total_size)).unwrap_or(0)); change the assignment where percent is
computed in download_file.rs accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f5effd13-c8cc-43bb-b27d-a614ecb0a447

📥 Commits

Reviewing files that changed from the base of the PR and between 0790343 and 3149b2c.

📒 Files selected for processing (21)
  • rust-toolchain.toml
  • src/blocks/tipset.rs
  • src/cid_collections/hash_map.rs
  • src/cid_collections/mod.rs
  • src/cli/humantoken.rs
  • src/cli/subcommands/net_cmd.rs
  • src/db/car/forest/index/hash.rs
  • src/db/car/forest/index/mod.rs
  • src/db/gc/snapshot.rs
  • src/db/memory.rs
  • src/eth/transaction.rs
  • src/libp2p/discovery.rs
  • src/lotus_json/ipld.rs
  • src/lotus_json/mod.rs
  • src/lotus_json/opt.rs
  • src/lotus_json/raw_bytes.rs
  • src/lotus_json/vec.rs
  • src/rpc/methods/chain.rs
  • src/state_manager/mod.rs
  • src/tool/subcommands/net_cmd.rs
  • src/utils/net/download_file.rs

Comment thread src/utils/net/download_file.rs Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 82.81250% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.87%. Comparing base (0790343) to head (a432ad4).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/libp2p/discovery.rs 45.45% 6 Missing ⚠️
src/utils/net/download_file.rs 0.00% 4 Missing ⚠️
src/cid_collections/hash_map.rs 89.28% 3 Missing ⚠️
src/db/gc/snapshot.rs 0.00% 3 Missing ⚠️
src/lotus_json/ipld.rs 81.25% 2 Missing and 1 partial ⚠️
src/cli/subcommands/net_cmd.rs 0.00% 1 Missing ⚠️
src/db/car/forest/index/mod.rs 97.05% 1 Missing ⚠️
src/tool/subcommands/net_cmd.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/blocks/tipset.rs 84.80% <100.00%> (+0.08%) ⬆️
src/cid_collections/mod.rs 97.01% <100.00%> (+0.24%) ⬆️
src/cli/humantoken.rs 99.34% <100.00%> (+0.02%) ⬆️
src/db/car/forest/index/hash.rs 100.00% <100.00%> (ø)
src/db/memory.rs 88.81% <100.00%> (ø)
src/eth/transaction.rs 86.84% <100.00%> (-0.15%) ⬇️
src/lotus_json/mod.rs 75.00% <ø> (ø)
src/lotus_json/opt.rs 86.66% <100.00%> (+3.33%) ⬆️
src/lotus_json/raw_bytes.rs 100.00% <100.00%> (ø)
src/lotus_json/vec.rs 61.53% <100.00%> (+5.01%) ⬆️
... and 10 more

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0790343...a432ad4. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hanabi1224 hanabi1224 added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit 61502d6 Apr 20, 2026
34 checks passed
@hanabi1224 hanabi1224 deleted the hm/rust-1.95 branch April 20, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants