Skip to content

Refactor#3

Merged
timweri merged 1 commit into
mainfrom
thanh/refactor
May 28, 2026
Merged

Refactor#3
timweri merged 1 commit into
mainfrom
thanh/refactor

Conversation

@timweri

@timweri timweri commented May 28, 2026

Copy link
Copy Markdown
Owner

Extract fetch_json/with_retry helpers and check_package, inline lockfile parsing.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Refactors the CLI implementation by inlining lockfile parsing into main.rs and extracting reusable HTTP/JSON and retry helpers into the crates.io API client, reducing duplicated request/retry logic.

Changes:

  • Inlined Cargo.lock parsing into src/main.rs and removed the dedicated lockfile module.
  • Extracted a generic fetch_json helper and a with_retry retry wrapper inside CratesIoClient.
  • Moved per-package publish-date evaluation into a check_package helper.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main.rs Inlines lockfile parsing and factors package checking into a helper.
src/api.rs Adds fetch_json + with_retry helpers and rewires publish-date/version fetching through them.
src/lockfile.rs Removes the standalone lockfile parsing module after inlining into main.rs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main.rs
@timweri timweri merged commit 50a5551 into main May 28, 2026
6 checks passed
@timweri timweri deleted the thanh/refactor branch May 28, 2026 15:06
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