Skip to content

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Nov 4, 2025

Supports:

  • and <-> and_then
  • then_some <-> then

Example

fn foo() {
    let foo = Some("foo");
    return foo.and$0(Some("bar"));
}

Before this PR

Assist not applicable

After this PR

fn foo() {
    let foo = Some("foo");
    return foo.and_then(|| Some("bar"));
}

Supports:

- and <-> and_then
- then_some <-> then

Example
---
```rust
fn foo() {
    let foo = Some("foo");
    return foo.and$0(Some("bar"));
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn foo() {
    let foo = Some("foo");
    return foo.and_then(|| Some("bar"));
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 4, 2025
@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Nov 24, 2025
@A4-Tacks
Copy link
Member Author

I may need #21044 to add parameters to closure of and_then

Merged via the queue into rust-lang:master with commit 3f76561 Nov 24, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 24, 2025
@ShoyuVanilla
Copy link
Member

I may need #21044 to add parameters to closure of and_then

Okay, I'll look into it some hours later

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