Skip to content

Commit b134676

Browse files
authored
fix(lambda-rs-args): Optimize parsed argument lookup and positional argument assignment (#189)
## Summary Speed up `lambda-rs-args` parsing results and improve docs to match `lambda-rs` rustdoc conventions. ## Related Issues <!-- Link related issues using "Closes #123" or "Relates to #456" --> Relates to: (none) ## Changes <!-- List the key changes made in this PR --> - Build an index for `ParsedArgs` so `has()` / `get_*()` are O(1) by name instead of scanning. - Track a positional cursor so positional assignment after `--` is O(p) total instead of O(p^2). - Update rustdoc for the touched APIs/helpers using `# Arguments` / `# Returns` / `# Errors` / `# Panics` sections. ## Type of Change <!-- Mark the relevant option(s) with [x] --> - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] Feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] Documentation (updates to docs, specs, tutorials, or comments) - [x] Refactor (code change that neither fixes a bug nor adds a feature) - [x] Performance (change that improves performance) - [x] Test (adding or updating tests) - [ ] Build/CI (changes to build process or CI configuration) ## Affected Crates <!-- Mark the crate(s) affected by this change --> - [ ] `lambda-rs` - [ ] `lambda-rs-platform` - [x] `lambda-rs-args` - [ ] `lambda-rs-logging` - [ ] Other: ## Checklist <!-- Ensure the following before requesting review --> - [ ] Code follows the repository style guidelines (`cargo +nightly fmt --all`) - [ ] Code passes clippy (`cargo clippy --workspace --all-targets -- -D warnings`) - [ ] Tests pass (`cargo test --workspace`) - [x] New code includes appropriate documentation - [x] Public API changes are documented - [ ] Breaking changes are noted in this PR description ## Testing <!-- Describe how the changes were tested --> **Commands run:** ```bash cargo test -p lambda-rs-args ``` **Manual verification steps (if applicable):** 1. N/A ## Screenshots/Recordings <!-- For visual changes, include before/after screenshots or recordings --> N/A ## Platform Testing <!-- Mark platforms where changes were verified --> - [x] macOS - [ ] Windows - [ ] Linux ## Additional Notes
2 parents ab6f5d9 + 27511d1 commit b134676

File tree

1 file changed

+231
-83
lines changed
  • crates/lambda-rs-args/src

1 file changed

+231
-83
lines changed

0 commit comments

Comments
 (0)