Skip to content

refactor: bump to edition 2024 #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2025
Merged

refactor: bump to edition 2024 #93

merged 2 commits into from
Apr 3, 2025

Conversation

kwaa
Copy link
Member

@kwaa kwaa commented Apr 3, 2025

Summary by CodeRabbit

  • Chores
    • Updated the internal configuration to adopt the latest language standards. This adjustment lays the groundwork for improved stability, performance, and compatibility with upcoming enhancements while ensuring a more robust future development process.

Copy link
Contributor

coderabbitai bot commented Apr 3, 2025

Walkthrough

This pull request updates the Rust edition specified in the Cargo.toml file. The change modifies the edition field under the [workspace.package] section from "2021" to "2024", reflecting a shift to the latest Rust edition. Additionally, several files have undergone reordering of import statements and re-exported items, but no functional changes were made in those files.

Changes

File Change Summary
Cargo.toml Updated [workspace.package]: changed edition from "2021" to "2024"
crates/api/src/lib.rs Re-export order updated: pub use routes::{routes, TAG};pub use routes::{TAG, routes};
crates/api_admin/src/lib.rs Re-export order updated: pub use routes::{routes, TAG};pub use routes::{TAG, routes};
crates/api_admin/src/routes/block_url.rs Reordered import statements for clarity.
crates/api_admin/src/routes/create_account.rs Reordered import statements for clarity.
crates/api_admin/src/routes/mod.rs Reintroduced import: openapi::security::{ApiKey, ApiKeyValue, SecurityScheme}
crates/api_admin/src/routes/remove_account.rs Reordered import statements for clarity.
crates/api_admin/src/routes/unblock_url.rs Reordered import statements for clarity.
crates/api_apub/src/users/user.rs Reordered import statements for clarity.
crates/api_apub/src/users/user_followers.rs Reordered import statements for clarity.
crates/api_apub/src/users/user_following.rs Reordered import statements for clarity.
crates/api_apub/src/users/user_inbox.rs Reordered import statements for clarity.
crates/api_apub/src/users/user_outbox.rs Reordered import statements for clarity.
crates/api_mastodon/src/entities/instance.rs Reordered import statements for clarity.
crates/api_mastodon/src/lib.rs Re-export order updated: pub use routes::{routes, TAG};pub use routes::{TAG, routes};
crates/api_mastodon/src/routes/instance/v1.rs Reordered import statements for clarity.
crates/api_mastodon/src/routes/instance/v2.rs Reordered import statements for clarity.
crates/api_mastodon/src/routes/statuses/status_context.rs Reordered import statements for clarity.
crates/api_mastodon/src/routes/statuses/status_favourited_by.rs Reordered import statements for clarity.
crates/api_mastodon/src/routes/statuses/status_reblogged_by.rs Reordered import statements for clarity.
crates/apub/src/actors/db_user.rs Reordered import statements for clarity.
crates/apub/src/actors/user_attachment.rs Reformatted initialization of attachment vector for readability.
crates/apub/src/objects/note.rs Reordered import statements for clarity.
crates/apub/src/utils/generate_map.rs Reordered import statements for clarity.
crates/backend/src/routes.rs Reordered import statements for clarity.
crates/db_schema/src/user.rs Reordered import statements for clarity.
crates/db_schema/src/user_feed_item.rs Reordered import statements for clarity.
crates/feed/src/user_feed.rs Reordered import statements for clarity.
crates/frontend/src/pages/home.rs Reordered import statements for clarity.
crates/frontend/src/pages/mod.rs Reordered import statements for clarity.
crates/frontend/src/partials/layout.rs Reordered import statements for clarity.
crates/nodeinfo/src/handler.rs Reordered import statements for clarity.
crates/nodeinfo/src/lib.rs Re-export order updated: pub use routes::{routes, TAG};pub use routes::{TAG, routes};
crates/tracing/src/lib.rs Reordered import statements for clarity.
crates/utils/src/data.rs Reordered import statements for clarity.
crates/utils/src/error.rs Reintroduced import: Json from axum crate.
crates/well_known/src/lib.rs Re-export order updated: pub use routes::{routes, TAG};pub use routes::{TAG, routes};
crates/well_known/src/routes/host_meta.rs Reordered import statements for clarity.
crates/well_known/src/routes/nodeinfo.rs Reordered import statements for clarity.
crates/well_known/src/routes/webfinger.rs Reordered import statements for clarity.

Poem

I'm a happy little bunny, hopping with delight,
Embracing the new edition, shining oh so bright.
From "2021" to "2024", our Rust journey takes flight,
Code leaps with energy, all snug and just right!
With every bound and line, the future feels light. 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00521fd and f51e44c.

📒 Files selected for processing (39)
  • crates/api/src/lib.rs (1 hunks)
  • crates/api_admin/src/lib.rs (1 hunks)
  • crates/api_admin/src/routes/block_url.rs (1 hunks)
  • crates/api_admin/src/routes/create_account.rs (1 hunks)
  • crates/api_admin/src/routes/mod.rs (1 hunks)
  • crates/api_admin/src/routes/remove_account.rs (1 hunks)
  • crates/api_admin/src/routes/unblock_url.rs (1 hunks)
  • crates/api_apub/src/users/user.rs (1 hunks)
  • crates/api_apub/src/users/user_followers.rs (1 hunks)
  • crates/api_apub/src/users/user_following.rs (1 hunks)
  • crates/api_apub/src/users/user_inbox.rs (1 hunks)
  • crates/api_apub/src/users/user_outbox.rs (1 hunks)
  • crates/api_mastodon/src/entities/instance.rs (1 hunks)
  • crates/api_mastodon/src/lib.rs (1 hunks)
  • crates/api_mastodon/src/routes/instance/v1.rs (1 hunks)
  • crates/api_mastodon/src/routes/instance/v2.rs (1 hunks)
  • crates/api_mastodon/src/routes/statuses/status_context.rs (1 hunks)
  • crates/api_mastodon/src/routes/statuses/status_favourited_by.rs (1 hunks)
  • crates/api_mastodon/src/routes/statuses/status_reblogged_by.rs (1 hunks)
  • crates/apub/src/actors/db_user.rs (1 hunks)
  • crates/apub/src/actors/user_attachment.rs (1 hunks)
  • crates/apub/src/objects/note.rs (1 hunks)
  • crates/apub/src/utils/generate_map.rs (1 hunks)
  • crates/backend/src/routes.rs (1 hunks)
  • crates/db_schema/src/user.rs (1 hunks)
  • crates/db_schema/src/user_feed_item.rs (1 hunks)
  • crates/feed/src/user_feed.rs (1 hunks)
  • crates/frontend/src/pages/home.rs (1 hunks)
  • crates/frontend/src/pages/mod.rs (1 hunks)
  • crates/frontend/src/partials/layout.rs (1 hunks)
  • crates/nodeinfo/src/handler.rs (1 hunks)
  • crates/nodeinfo/src/lib.rs (1 hunks)
  • crates/tracing/src/lib.rs (1 hunks)
  • crates/utils/src/data.rs (1 hunks)
  • crates/utils/src/error.rs (1 hunks)
  • crates/well_known/src/lib.rs (1 hunks)
  • crates/well_known/src/routes/host_meta.rs (1 hunks)
  • crates/well_known/src/routes/nodeinfo.rs (1 hunks)
  • crates/well_known/src/routes/webfinger.rs (1 hunks)
✅ Files skipped from review due to trivial changes (38)
  • crates/api_apub/src/users/user_following.rs
  • crates/api_admin/src/lib.rs
  • crates/api_mastodon/src/routes/instance/v2.rs
  • crates/nodeinfo/src/handler.rs
  • crates/db_schema/src/user_feed_item.rs
  • crates/api/src/lib.rs
  • crates/api_mastodon/src/entities/instance.rs
  • crates/api_mastodon/src/lib.rs
  • crates/api_apub/src/users/user.rs
  • crates/nodeinfo/src/lib.rs
  • crates/frontend/src/pages/mod.rs
  • crates/api_apub/src/users/user_followers.rs
  • crates/well_known/src/routes/nodeinfo.rs
  • crates/apub/src/actors/user_attachment.rs
  • crates/apub/src/objects/note.rs
  • crates/api_mastodon/src/routes/statuses/status_reblogged_by.rs
  • crates/feed/src/user_feed.rs
  • crates/tracing/src/lib.rs
  • crates/well_known/src/lib.rs
  • crates/backend/src/routes.rs
  • crates/api_apub/src/users/user_outbox.rs
  • crates/well_known/src/routes/webfinger.rs
  • crates/db_schema/src/user.rs
  • crates/api_admin/src/routes/remove_account.rs
  • crates/api_mastodon/src/routes/statuses/status_context.rs
  • crates/api_admin/src/routes/create_account.rs
  • crates/api_mastodon/src/routes/statuses/status_favourited_by.rs
  • crates/frontend/src/partials/layout.rs
  • crates/frontend/src/pages/home.rs
  • crates/apub/src/actors/db_user.rs
  • crates/apub/src/utils/generate_map.rs
  • crates/api_apub/src/users/user_inbox.rs
  • crates/api_admin/src/routes/block_url.rs
  • crates/api_mastodon/src/routes/instance/v1.rs
  • crates/utils/src/error.rs
  • crates/api_admin/src/routes/unblock_url.rs
  • crates/utils/src/data.rs
  • crates/api_admin/src/routes/mod.rs
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: check
🔇 Additional comments (2)
crates/well_known/src/routes/host_meta.rs (2)

4-9: Import reordering looks good.

The Json type has been moved to the beginning of the axum imports, which is consistent with the alphabetical ordering pattern being implemented across the codebase as part of the Rust 2024 edition update.


12-12: Consistent import reordering.

The order of imports from crate has been changed to put TAG before entities::HostMeta, maintaining alphabetical ordering. This change is consistent with the import reorganization happening throughout the codebase.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kwaa kwaa merged commit 799cdd9 into main Apr 3, 2025
1 check passed
@kwaa kwaa deleted the feat/edition-2024 branch April 3, 2025 13:32
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