Commit b078cca
Modernize Rust syntax patterns (#38)
* Fix GLIBC version mismatch in Docker build
Use rust:bookworm instead of rust:latest for the build stage
to match the runtime stage (debian:bookworm-slim).
rust:latest is now based on a newer Debian version with GLIBC 2.38,
while bookworm-slim has GLIBC 2.36, causing runtime failures.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Modernize Rust syntax patterns
This commit updates the codebase to use modern Rust idioms and patterns:
- Replace turbofish type annotations (::<_, _, _, ()>) with type ascription (let _: () =) for unit-returning Redis operations, improving readability
- Use let-else syntax (Rust 2021+) instead of is_none() + unwrap() patterns for cleaner early returns
- Replace is_err() + unwrap_err() with if-let Err for more idiomatic error handling
- Eliminate unnecessary .clone() calls on Option types before unwrap by using as_ref()
- Optimize memory usage by removing .to_vec() from chunk iteration where not needed
- Remove explicit return statements in favor of implicit returns (Rust style guide)
These changes improve code clarity, reduce allocations, and align with modern Rust best practices without changing functionality.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Upgrade redis crate from 0.22.0 to 1.0.2
This commit upgrades the redis dependency to version 1.0.2, eliminating
the future incompatibility warnings related to never type fallback.
Breaking changes addressed:
1. **Async connection method renamed**
- Changed `.get_async_connection()` to `.get_multiplexed_async_connection()`
- The new multiplexed connection is designed for concurrent use without pooling
2. **Connection construction modernized**
- Replaced manual `ConnectionInfo` struct construction with connection URL strings
- Added `redis_url()` helper function to build proper redis:// or rediss:// URLs
- Handles username, password, SSL, host, port, and database parameters
- Avoids issues with private fields introduced in redis 1.0 (`tcp_settings`, etc.)
- Username now uses `ArcStr` internally (handled automatically by URL parsing)
3. **Import cleanup**
- Removed unused imports: `ConnectionAddr`, `ConnectionInfo`, `RedisConnectionInfo`
- These types are no longer needed with URL-based connection approach
Benefits of the upgrade:
- ✅ Eliminates never type fallback warnings (future Rust 2024 compatibility)
- ✅ Adds default connection/response timeouts (5s/10s) to prevent indefinite hangs
- ✅ Better async performance with multiplexed connections
- ✅ More maintainable connection string approach
- ✅ Zero-copy deserialization improvements in underlying library
All tests pass. No functional changes to application behavior.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Address Copilot review feedback
1. Add URL encoding for Redis credentials
- Add percent-encoding dependency (already in transitive deps)
- Encode username and password to handle special characters (@, :, etc.)
- Prevents connection failures when credentials contain URL-unsafe chars
2. Replace unsafe unwrap with expect
- Change unwrap() to expect() with descriptive message
- Makes panic reason explicit if logic error occurs
- Improves debugging experience
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Update src/deploy/mod.rs
Co-authored-by: Julius <41292439+infernalfire72@users.noreply.github.com>
* Update src/deploy/mod.rs
Co-authored-by: Julius <41292439+infernalfire72@users.noreply.github.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Julius <41292439+infernalfire72@users.noreply.github.com>1 parent 9155d9f commit b078cca
12 files changed
Lines changed: 201 additions & 82 deletions
File tree
- src
- api
- routes
- reworks
- deploy
- individual_recalc
- mass_recalc
- processor
- repositories
- usecases
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
0 commit comments