Skip to content

chore(backend): raise rust-version to the pinned 1.97 toolchain - #54

Open
selmant wants to merge 1 commit into
developfrom
chore/rust-version-1.97
Open

selmant wants to merge 1 commit into
developfrom
chore/rust-version-1.97

Conversation

@selmant

@selmant selmant commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

rust-toolchain.toml already pins Rust 1.97.1, but rust-version in backend-rs/Cargo.toml still said 1.85. That kept clippy from suggesting std APIs added since 1.85, and stopped me from making Secret::is_empty a const fn in the AI work.

This raises rust-version to 1.97 and applies what clippy now asks for. Every change is mechanical and behaves the same:

  • 43 × Duration::from_secs(60) → Duration::from_mins(1), and similar for hours (from_mins/from_hours became stable in 1.91)
  • 11 functions are now const fn
  • 2 × n % k == 0 → n.is_multiple_of(k)

All of these came from cargo clippy --fix. Clippy (--all-targets -D warnings) passed afterwards with no further changes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Platform Requirements
    • Building the backend now requires Rust 1.97 or later.
  • Compatibility
    • Cache lifetimes, timeouts, and existing behavior remain unchanged; no user-facing functionality changes in this release.

rust-toolchain.toml already pins 1.97.1, so 1.85 was only holding clippy
back from newer std APIs. Applies what that unlocks: Duration::from_mins
and from_hours, is_multiple_of, and const fns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Hey @selmant, thanks for submitting this PR! However, it looks like the PR template hasn't been fully filled out.

Issues found:

  • Description section is empty or only contains placeholder text.
  • How Has This Been Tested? section is empty.
  • Checklist section is missing or has been removed.
  • The contribution guidelines checkbox has not been checked.

Please update your PR description to follow the PR template.
Incomplete or missing PR descriptions may indicate insufficient review of the changes, and PRs that do not follow the template may be closed without review.
See our Contributing Guide for more details.

This check will automatically re-run when you edit your PR description.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Rust package now requires Rust 1.97. Across the backend, equivalent duration expressions use minute- and hour-based constructors, selected arithmetic checks use updated methods, and selected functions are declared const. The summaries report no changes to the described durations or function behavior.

Changes: Rust backend updates

Layer / File(s) Summary
Version, duration, and arithmetic updates
backend-rs/Cargo.toml, backend-rs/src/*.rs, backend-rs/src/mappinglayer/*, backend-rs/src/routes/*
The Rust version requirement changes from 1.85 to 1.97. Duration expressions use minute- and hour-based constructors without changing their stated values. Two arithmetic checks are rewritten with is_multiple_of.
Const function declarations
backend-rs/src/jobs/cron.rs, backend-rs/src/mappinglayer/*, backend-rs/src/mdblist.rs, backend-rs/src/routes/*, backend-rs/src/runtime/plugin.rs, backend-rs/src/typeorm.rs
Selected functions and methods become const fn; their described checks and results remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • selmant/foreseerr#10: Adds the Rust version requirement and toolchain pin referenced by this PR’s version update.
Merge Risk: Minimal · up to 4923c

No actionable code risk is established in these compatibility and expression updates. Merge readiness remains subject to normal checks and completing the required PR description.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: raising the crate's rust-version from 1.85 to 1.97 to match the pinned 1.97.1 toolchain. The raw summary confirms that Cargo.toml change. The rest of the diff (Duratio…
Docstring Coverage Passed Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: raising the crate's rust-version from 1.85 to 1.97 to match the pinned 1.97.1 toolchain. The raw summary confirms that Cargo.toml change. The rest of the diff (Duration constructor swaps, const fn changes, is_multiple_of replacements) follows from the Clippy-driven update that the objectives describe. The title does not mention those edits, but it does not need to cover every detail.

Full details: Docstring Coverage

Explanation

Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 33 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 609c9a9 and 4923c01.

Files selected for processing: 34

  • backend-rs/Cargo.toml
  • backend-rs/src/anilist.rs
  • backend-rs/src/dnscache.rs
  • backend-rs/src/dnsresolve.rs
  • backend-rs/src/email.rs
  • backend-rs/src/github.rs
  • backend-rs/src/jobs/cron.rs
  • backend-rs/src/libraryimagecache.rs
  • backend-rs/src/mappingdatasets.rs
  • backend-rs/src/mappinglayer/edges.rs
  • backend-rs/src/mappinglayer/mod.rs
  • backend-rs/src/mappinglayer/probe.rs
  • backend-rs/src/mappinglayer/resolve.rs
  • backend-rs/src/mappingpacks.rs
  • backend-rs/src/mdblist.rs
  • backend-rs/src/memcache.rs
  • backend-rs/src/openapi/ajv.rs
  • backend-rs/src/plexwatchlist.rs
  • backend-rs/src/ratings.rs
  • backend-rs/src/routes/discoverkit.rs
  • backend-rs/src/routes/mediaimports.rs
  • backend-rs/src/routes/plexxml.rs
  • backend-rs/src/routes/procstate/health.rs
  • backend-rs/src/routes/procstate/tvdbshow.rs
  • backend-rs/src/routes/sonarrstorage.rs
  • backend-rs/src/routes/traktpages.rs
  • backend-rs/src/routes/traktrecs.rs
  • backend-rs/src/rowcache.rs
  • backend-rs/src/runtime/plugin.rs
  • backend-rs/src/servarr.rs
  • backend-rs/src/sonarrv5.rs
  • backend-rs/src/tmdb.rs
  • backend-rs/src/tvdb.rs
  • backend-rs/src/typeorm.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant