casey / casey/rust-rfc-wishlist

Guards

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

If we want to capture part of a single pattern, we can do:

```rust
if let Some(foo_contents) = foo {
// foo_contents binding is valid here
}

// foo_contents binding is not valid here
```

In some cases this forces an extra layer of nesting. It would be nice to be able to do something like the following:

```rust
let Some(foo_contents) = foo else {
// foo_contents binding is not valid here
}

// foo_contents binding is valid here
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the proposed Rust syntax and its binding-scope examples in the issue. Determine the language-design and implementation areas affected, then define the accepted behavior and supporting tests before considering the work done.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.