Skip to content

fix(clippy): rename deprecated fetch_update to try_update - #633

Merged
MichaelTaylor3d merged 1 commit into
developfrom
loop/3442-clippy-try-update
Oct 2, 2026
Merged

MichaelTaylor3d merged 1 commit into
developfrom
loop/3442-clippy-try-update

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

Rust 1.99.0 (2026-09-28) renames AtomicUsize::fetch_update to try_update for consistency with the standard library. This PR updates the two deprecated calls in dig-node-core.

Refs DIG-Network/dig_ecosystem#3442
Run: 36951759927

Rust 1.99.0 renames AtomicUsize::fetch_update to try_update for consistency.

Refs DIG-Network/dig_ecosystem#3442
@MichaelTaylor3d

Copy link
Copy Markdown
Contributor Author

PASS - security audit, #633 (ticket dig_ecosystem#3442)

Head audited: 773ae94

  • Diff is 2 one-line renames of AtomicX::fetch_update to try_update. Both argument orderings stay (SeqCst, SeqCst), the closures are untouched, and the surrounding Ok/Err handling is untouched. try_update is the stabilised successor with the same (set_order, fetch_order, f) signature and Result<T, T> return.
  • Both sites are inside #[cfg(test)] mod tests (coinset_resolver.rs:332-333, line 418; module_reshare.rs:1000-1001, line 1625). They are a mock resolver's answers-left counter and a mock downloader's budget. No production guard, rate limit, once-flag or reshare budget is touched. The cfg(test) code is not compiled into release binaries.
  • No remaining fetch_update in crates/.
  • Findings: none (no LIVE issue, no defence-in-depth item).

Not covered: toolchain behaviour of try_update itself (std, assumed per its documented identical semantics); gitnexus/socraticode were unavailable and not needed for a two-line diff.

@MichaelTaylor3d MichaelTaylor3d left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verdict: PASS at head 773ae94 (reviewed read-only; no code edited).

Criteria checked:

  1. Semantics identical. Read core/src/sync/atomic.rs of the installed stable toolchain (rustc 1.98.1): fetch_update is a literal alias, #[deprecated(since = "1.99.0", note = "renamed to try_update")], whose body is self.try_update(set_order, fetch_order, f). Both have signature (set_order, fetch_order, f) -> Result<T, T> with Ok(previous) / Err(current). Same argument order, same return meaning.
  2. Orderings unchanged at both sites: coinset_resolver.rs:418 and module_reshare.rs:1625 stay SeqCst, SeqCst; closures untouched. Diff is exactly +1/-1 per file.
  3. Toolchain admits it: no rust-toolchain file; CI uses dtolnay/rust-toolchain@stable and rustup toolchain install stable. try_update is #[stable(since = "1.95.0")], and the 1.99 clippy that fails #632 is newer. The only rust-version in the repo is 1.75.0 in crates/dig-chat-protocol, which has no fetch_update or try_update, so it does not apply. Both changed sites are in mod tests of dig-node-core.
  4. No remaining uses: grep -rn fetch_update over the whole tree at this head (target, .git, node_modules excluded) returns zero hits.
  5. Checks: all 13 checks on #633 pass, including Clippy, Rustfmt, Test + coverage and CodeQL.

Not run: a local build under rust 1.99 (installed toolchain is 1.98.1, which compiles try_update; the CI Clippy pass covers the lint). Test-vacuity gate does not apply: a lint-only rename that changes no behaviour, so there is no fix to revert.

Threads: none opened, none open.

@MichaelTaylor3d
MichaelTaylor3d marked this pull request as ready for review October 2, 2026 05:30
@MichaelTaylor3d
MichaelTaylor3d merged commit f1e9f80 into develop Oct 2, 2026
14 checks passed
@MichaelTaylor3d
MichaelTaylor3d deleted the loop/3442-clippy-try-update branch October 2, 2026 05:31
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.

1 participant