refactor(encryption): return the AES-NI probe directly (LAB-6339) - #81
Conversation
clippy 1.100 (beta) extends needless_bool to an `if c { return true; }`
guard followed by `false`, and CI's beta job runs clippy with -D warnings,
so every open PR shows a red beta check. The x86 fallback now returns
is_x86_feature_detected!("aes") as its tail expression, the same shape as
the aarch64 branch below it. Behaviour is unchanged.
Fixing it on main rather than in each PR also covers the required stable
checks once 1.100 reaches stable.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: cachekit-io/cachekit-core/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe x86 and x86_64 AES feature check now returns the runtime probe result directly instead of using an explicit conditional. ChangesAES feature detection
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to This preserves x86 and x86_64 AES capability reporting, with no material user impact or merge risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This PR simplifies the x86 runtime-detection fallback in
ZeroKnowledgeEncryptor::detect_hardware_acceleration(src/encryption/core.rs). The code previously used anif is_x86_feature_detected!("aes") { return true; } falseguard. It now returnsis_x86_feature_detected!("aes")directly as the block's tail expression.Scope and impact
#[cfg(not(target_feature = "aes"))]path on x86. When AES is enabled at compile time, the static-detection branch is unaffected. The aarch64 branch is also unaffected.Motivation
needless_boollint under the current beta toolchain (clippy 1.100).-D warnings), so the lint was failing thebeta / ubuntu-latestjob on all open PRs.Test coverage
test_hardware_acceleration_matches_platform_probetest continues to assert that the reported flag equalsis_x86_feature_detected!("aes")on x86. This confirms the refactor preserves the original semantics.Summary by CodeRabbit