Skip to content

SmolStr: DerefPure#21808

Open
bend-n wants to merge 1 commit intorust-lang:masterfrom
bend-n:smolstrcolonderefpure2
Open

SmolStr: DerefPure#21808
bend-n wants to merge 1 commit intorust-lang:masterfrom
bend-n:smolstrcolonderefpure2

Conversation

@bend-n
Copy link

@bend-n bend-n commented Mar 13, 2026

enables matching on smolstrs directly.

before:

match Some(smolstr) {
   Some(x) if x == "y" => {},
   _ => {}
}

after:

match Some(smolstr) {
   Some("y") => {},
   _ => {}
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 13, 2026
@ChayimFriedman2
Copy link
Contributor

I'm personally not a fan of this change. Deref patterns is a hugely experimental feature currently.

But, no strong opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants