Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional path parameters #147

Merged
merged 1 commit into from
Sep 10, 2024
Merged

Conversation

CathalMullan
Copy link
Contributor

@CathalMullan CathalMullan commented Sep 8, 2024

Realising that with this approach, we can have any number of optionals, anywhere in a route.

Not sure if that's a good thing or not.

Long term, I'd like to add a real parser that can do this in one pass, but the additive approach is fine for now. Once we have benchmarks for inserts/deletes, that will help. Syntax isn't really "set" yet, either.

This is 'good enough' for now.

@CathalMullan CathalMullan linked an issue Sep 8, 2024 that may be closed by this pull request
6 tasks
Copy link

codecov bot commented Sep 8, 2024

Codecov Report

Attention: Patch coverage is 84.03990% with 64 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/expander.rs 80.82% 0 Missing and 37 partials ⚠️
src/parser.rs 90.76% 5 Missing and 7 partials ⚠️
src/router.rs 76.59% 10 Missing and 1 partial ⚠️
src/node/delete.rs 75.00% 4 Missing ⚠️
Files with missing lines Coverage Δ
src/lib.rs 60.46% <ø> (+4.90%) ⬆️
src/node/insert.rs 93.26% <100.00%> (+1.50%) ⬆️
src/node/search.rs 79.20% <100.00%> (+0.48%) ⬆️
src/node/delete.rs 77.77% <75.00%> (-0.61%) ⬇️
src/router.rs 84.57% <76.59%> (-3.11%) ⬇️
src/parser.rs 96.70% <90.76%> (-1.90%) ⬇️
src/expander.rs 80.82% <80.82%> (ø)

Copy link

codspeed-hq bot commented Sep 8, 2024

CodSpeed Performance Report

Merging #147 will improve performances by 5.37%

Comparing 95-support-optional-path-parameters (75efabb) with main (148353a)

Summary

⚡ 1 improvements
✅ 15 untouched benchmarks

Benchmarks breakdown

Benchmark main 95-support-optional-path-parameters Change
matchit benchmarks/path-tree 13.9 µs 13.2 µs +5.37%

@CathalMullan CathalMullan force-pushed the 95-support-optional-path-parameters branch 9 times, most recently from 53c7e1e to 9353c4d Compare September 10, 2024 13:22
@CathalMullan CathalMullan marked this pull request as ready for review September 10, 2024 13:22
@CathalMullan CathalMullan force-pushed the 95-support-optional-path-parameters branch 17 times, most recently from 1f83a6b to a45674f Compare September 10, 2024 21:33
@CathalMullan CathalMullan force-pushed the 95-support-optional-path-parameters branch 5 times, most recently from ecf3266 to ebe1e34 Compare September 10, 2024 22:55
@CathalMullan CathalMullan force-pushed the 95-support-optional-path-parameters branch from ebe1e34 to 75efabb Compare September 10, 2024 23:01
@CathalMullan CathalMullan merged commit 026b1d3 into main Sep 10, 2024
6 of 7 checks passed
@CathalMullan CathalMullan deleted the 95-support-optional-path-parameters branch September 10, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support optional path parameters
1 participant