Skip to content

Commit

Permalink
Revert Request::params back to Option (#2695)
Browse files Browse the repository at this point in the history
Follow-up to #2694.

When `Request::params` was made into an ArrayVec, the `Option` around it
was removed in order to avoid having to add a turbofish on `None` to
specify the value of `MAX_PARAMS`. Also, `Request::new` also needed to
be changed so that the value of `MAX_PARAMS` could be inferred. Now that
the field is a slice again, we can wrap it in `Option` again (at no cost
to size, thanks to niche opts).

We ensure we never store the redundant `Some(&[])` by checking for an
empty slice and storing `None` instead. This way, we ensure we never
read an empty slice out of the `Some` variant.
  • Loading branch information
mkrasnitski authored and GnomedDev committed May 14, 2024
1 parent bbb324a commit 7f092bd
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 207 deletions.
Loading

0 comments on commit 7f092bd

Please sign in to comment.