🧹 Refactor TokenResponse to local scope#108
Conversation
…gin method Co-authored-by: ffalcinelli <1167082+ffalcinelli@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
==========================================
- Coverage 92.94% 92.86% -0.09%
==========================================
Files 33 33
Lines 2239 2241 +2
==========================================
Hits 2081 2081
- Misses 158 160 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: ffalcinelli <1167082+ffalcinelli@users.noreply.github.com>
Co-authored-by: ffalcinelli <1167082+ffalcinelli@users.noreply.github.com>
🎯 What: Moved the
TokenResponsestruct definition from the module scope insrc/client.rsinto theloginfunction.💡 Why:
TokenResponseis a single-use Data Transfer Object (DTO) only needed when parsing the JSON response of the login token endpoint. Defining it globally unnecessarily pollutes the module scope. Scoping it locally inside the function improves maintainability by explicitly isolating its lifecycle and keeping related code grouped together.✅ Verification: Verified the fix by running the full test suite (
cargo test), ensuring all tests pass (ignoring the unrelated known failure oftest_real_keycloak_integrationdue to docker overlayfs).✨ Result: Improved module cleanliness and code encapsulation without altering existing behavior.
PR created automatically by Jules for task 12498791933533764945 started by @ffalcinelli