Skip to content

Conversation

ntBre
Copy link
Contributor

@ntBre ntBre commented Aug 20, 2025

Summary

I noticed while working on #20006 that we had a custom unwrap function for Option. This has been const on stable since 1.83 (docs, release notes), so I think it's safe to use now. I grepped a bit for related todos and found this one for AsciiCharSet but no others.

Test Plan

Existing tests

Summary
--

I noticed while working on #20006 that we had a custom `unwrap` function for
`Option`. This has been const on stable since 1.83 (docs, release notes), so I
think it's safe to use now. I grepped a bit for related todos and found this one
for `AsciiCharSet` but no others.

Test Plan
--

Existing tests
@ntBre ntBre added the internal An internal refactor or improvement label Aug 20, 2025
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Nice

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@ntBre ntBre merged commit 1a38831 into main Aug 20, 2025
36 checks passed
@ntBre ntBre deleted the brent/unwrap branch August 20, 2025 17:40
dcreager added a commit that referenced this pull request Aug 21, 2025
* main: (29 commits)
  [ty] add docstrings to completions based on type (#20008)
  [`pyupgrade`] Avoid reporting `__future__` features as unnecessary when they are used (`UP010`) (#19769)
  [`flake8-use-pathlib`] Add fixes for `PTH102` and `PTH103` (#19514)
  [ty] correctly ignore field specifiers when not specified (#20002)
  `Option::unwrap` is now const (#20007)
  [ty] Re-arrange "list modules" implementation for Salsa caching
  [ty] Test "list modules" versus "resolve module" in every mdtest
  [ty] Wire up "list modules" API to make module completions work
  [ty] Tweak some completion tests
  [ty] Add "list modules" implementation
  [ty] Lightly expose `FileModule` and `NamespacePackage` fields
  [ty] Add some more helper routines to `ModulePath`
  [ty] Fix a bug when converting `ModulePath` to `ModuleName`
  [ty] Split out another constructor for `ModuleName`
  [ty] Add stub-file tests to existing module resolver
  [ty] Expose some routines in the module resolver
  [ty] Add more path helper functions
  [`flake8-annotations`] Remove unused import in example (`ANN401`) (#20000)
  [ty] distinguish base conda from child conda (#19990)
  [ty] Fix server hang (#19991)
  ...
ntBre added a commit that referenced this pull request Sep 25, 2025
I guess I missed these in #20007, but I found them today while grepping for
something else. `Option::unwrap` has been const since 1.83, so we can use it
here and avoid some unsafe code.
ntBre added a commit that referenced this pull request Sep 25, 2025
I guess I missed these in #20007, but I found them today while grepping
for something else. `Option::unwrap` has been const since 1.83, so we
can use it here and avoid some unsafe code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants