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

&Option<T> -> Option<&T> #11091

Merged
merged 3 commits into from
Jul 9, 2024
Merged

&Option<T> -> Option<&T> #11091

merged 3 commits into from
Jul 9, 2024

Conversation

Rudxain
Copy link
Contributor

@Rudxain Rudxain commented Jul 4, 2024

Full explanation: "Choose the Right Option" by Logan Smith

NPO

TLDR:

  • internal APIs are less likely to break, as implementation details aren't exposed
  • flexibility
  • memory optimizations

@Rudxain Rudxain changed the title refactor starting_request_args to only ref non-Copy refactor &Option<T> -> Option<&T> Jul 4, 2024
@Rudxain Rudxain marked this pull request as ready for review July 4, 2024 23:40
@Rudxain Rudxain changed the title refactor &Option<T> -> Option<&T> &Option<T> -> Option<&T> Jul 4, 2024
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try to avoid cosmetic refactors but these code paths are almost never touched in other PRs so this seems ok to me. Also please write an actual description instead of a youtube link in the future.

@Rudxain
Copy link
Contributor Author

Rudxain commented Jul 5, 2024

please write an actual description instead of a youtube link in the future.

Agreed. I also forgot to avoid this. I'll fix it now

@Rudxain
Copy link
Contributor Author

Rudxain commented Jul 5, 2024

BTW, I've found a related lint

@archseer archseer merged commit 6997ee9 into helix-editor:master Jul 9, 2024
6 checks passed
@Rudxain Rudxain deleted the patch-3 branch July 10, 2024 15:31
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* refactor `starting_request_args` to only `ref` non-`Copy`

* refactor `needs_recompile` to only `ref` non-`Copy`

* refactor `add_workspace_folder` to only `ref` `Some`

---------

Co-authored-by: Rudxain <[email protected]>
@TornaxO7 TornaxO7 mentioned this pull request Jul 15, 2024
38 tasks
mxxntype pushed a commit to mxxntype/helix that referenced this pull request Aug 14, 2024
* refactor `starting_request_args` to only `ref` non-`Copy`

* refactor `needs_recompile` to only `ref` non-`Copy`

* refactor `add_workspace_folder` to only `ref` `Some`

---------

Co-authored-by: Rudxain <[email protected]>
kyruzic pushed a commit to kyruzic/helix that referenced this pull request Sep 27, 2024
* refactor `starting_request_args` to only `ref` non-`Copy`

* refactor `needs_recompile` to only `ref` non-`Copy`

* refactor `add_workspace_folder` to only `ref` `Some`

---------

Co-authored-by: Rudxain <[email protected]>
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.

3 participants