Commit 8c32d7b
committed
Merge torrust#818: feat: prepare for Rust 2024 edition and update dependencies
47189a3 chore: fix formatting (Cameron Garnham)
2b76d6f refactor: migrate to axum 0.8, axum-server 0.8, and rand 0.10 APIs (Cameron Garnham)
7cf635c chore: update cargo dependencies (Cameron Garnham)
b72f7ad refactor: migrate to Cargo lint workspace and address new warnings (Cameron Garnham)
9238b66 chore: address clippy warnings and code cleanup (Cameron Garnham)
Pull request description:
## Summary
This PR prepares the codebase for migration to Rust 2024 edition while updating
dependencies and improving code quality. The changes include adding Rust 2024
compatibility lint warnings, updating multiple dependencies to their latest
versions, and applying modern Rust patterns throughout the codebase.
## Key Changes
### Rust 2024 Preparation
- Added `rust-2024-compatibility` lint with warning level
- Updated lints configuration to use workspace inheritance
- Applied `Self::` pattern for enum variant matching
- Added `const fn` to many default value functions for compile-time evaluation
### Dependency Updates
- Updated multiple crates in `Cargo.lock` to latest versions
- Removed `rand_core` as it is included implicitly now.
- Added `query` feature to `reqwest` for improved URL query handling
- Updated `ahash`, `anstream`, `aho-corasick` and other dependencies
### Code Quality Improvements
- Replaced `.into()` with `.try_into().expect(...)` for multipart form handling
to provide clearer error messages
- Applied clippy suggestions including `Self` usage and `const` functions
- Fixed `.clone()` calls where direct references could be used
- Added missing `Eq` derives to structs that require it
### Development Workflow
- Added `AGENTS.md` with cargo command guidelines
- Simplified GitHub Actions cargo commands by removing redundant flags
- Updated `.cargo/config.toml` to remove overly restrictive rustflags
- Improved VS Code settings for better rust-analyzer integration
## Testing Performed
- All existing tests continue to pass with updated dependencies
- Multipart form handling changes maintain backward compatibility
- Const function additions are compile-time verified
- No breaking changes to public API
## Breaking Changes
None. This is a preparatory change that maintains full backward compatibility.
## Migration Needed
No migration required. The Rust 2024 compatibility is currently at warning level
only, allowing gradual migration when the edition is officially adopted.
## References
- Rust 2024 Edition RFC and migration guide
- Dependency changelogs for updated crates
- Internal code quality improvement initiative
ACKs for top commit:
da2ce7:
ACK 47189a3
Tree-SHA512: aa6695966585836a6947cccfe0548a69676fb080ea8c727377e9874103de54b14a5bcf83031b4422f1015cfbf9ca15d88e2800a588946fee49e261c9c98d4acc111 files changed
Lines changed: 2627 additions & 1971 deletions
File tree
- .cargo
- .github/workflows
- .vscode
- packages/located-error
- src
- bin
- bootstrap
- cache
- image
- config
- v2
- console
- commands
- seeder
- tracker_statistics_importer
- cronjobs
- databases
- models
- services
- tracker
- ui
- upgrades/from_v1_0_0_to_v2_0_0/transferrers
- web/api
- client/v1
- contexts
- category
- settings
- tag
- torrent
- user
- server
- v1
- contexts
- category
- proxy
- tag
- torrent
- user
- extractors
- tests
- common
- contexts
- category
- settings
- tag
- torrent
- user
- e2e
- web/api/v1/contexts
- category
- settings
- tag
- torrent
- environments
- upgrades/from_v1_0_0_to_v2_0_0
- transferrer_testers
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
13 | | - | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments