Improve builder-rs: safety, documentation, and test coverage #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Pull Request
📋 Description
Code quality improvements for the
builder-rsRust service. Eliminates panic-prone patterns, adds documentation and test coverage for critical utilities.Safety & Error Handling
unwrap()chains withok_or_else()pattern matchingfile_name()operations that could panic on invalid pathsNonZerovaluesBefore:
After:
Code Quality
suceeded→succeeded#[must_use]toRateLimit::check()Defaultimpl forHealthServiceImplGOFILE_API_BASE,API_STATUS_OKDocumentation
git_repo,gofile_api,system_monitor,util,ratelimit,mainIMPROVEMENTS.mdwith detailed change summaryTesting
util.rs(path canonicalization, JSON parsing, file discovery)ratelimit.rs(timing behavior, blocking logic)tempfiledev dependency for test isolation✅ Checklist
cmake+make/ninjaand verified the project builds.🧪 Test Plan
cargo fmtand verified formatting compliancecargo testto validate all unit tests pass📝 Notes
Statistics: 11 files, +610/-84 lines, ~200 lines documentation, ~130 lines tests
All error handling improvements maintain existing behavior while eliminating panic points. Tests use descriptive
expect()messages for clarity on failure.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.