bors[bot] 190f37afab
Merge #9600
9600: fix: Single-line and nested blocks in the `unwrap_block` assist r=Veykril a=patrick-gu

Fixes #8411

Rework the system for stripping whitespace and braces in the unwrap_block assist to allow correct unwrapping of blocks such as:
```rust
{ $0 0 }
```
into
```rust
0
```

and nested blocks, such as:
```rust
$0{
    {
        3
    }
}
```
into
```rust
{
    3
}
```

This is done by creating the `update_expr_string_with_pat` function (along with `update_expr_string` and `update_expr_string_without_newline`), which strips whitespace and braces in a way that ensures that only whitespace and a maximum of one brace are removed from the start and end of the expression string.

I have also created several tests to ensure that this functionality works correctly.

Co-authored-by: patrick-gu <55641350+patrick-gu@users.noreply.github.com>
2021-07-15 00:45:55 +00:00
..
2021-07-05 14:19:41 +03:00
2021-07-05 14:19:41 +03:00
2021-07-09 11:01:55 -04:00
2021-07-08 15:49:39 +02:00
2021-07-11 16:14:39 +02:00
2021-07-15 00:20:44 +00:00
2021-07-14 18:20:01 +02:00
2021-07-05 14:19:41 +03:00
2021-07-05 14:19:41 +03:00
2021-07-05 14:19:41 +03:00
2021-07-05 14:19:41 +03:00
2021-07-12 15:19:53 +02:00
2021-07-09 11:01:55 -04:00
2021-07-05 14:19:41 +03:00
2021-07-12 15:34:49 +02:00
2021-07-08 16:43:39 +02:00
2021-07-10 17:25:16 +00:00
2021-07-05 14:19:41 +03:00
2021-07-05 14:19:41 +03:00
2021-07-05 14:19:41 +03:00
2021-07-05 14:19:41 +03:00