]> git.lizzy.rs Git - rust.git/commit
Merge #2099
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Sun, 27 Oct 2019 19:20:01 +0000 (19:20 +0000)
committerGitHub <noreply@github.com>
Sun, 27 Oct 2019 19:20:01 +0000 (19:20 +0000)
commit46b63c462d66925b59c0af7dec2eb3c48bc7be25
tree274837f2d667e2a91e253e3bd6d705f717369fbe
parent534c8a0d78a74e28415f07954d4d948ecfbd64ed
parent17bd3e59f86a4da548c6c61dff9421dfdb31b65c
Merge #2099

2099: Fix panic on raw string assist r=matklad a=aee11

Strings that do not contain two quotation marks would cause a slice indexing panic because `find_usual_string_range` would return a range that only contained a single quotation mark.
Panic example:
```
fn main() {
    let s = "<|>
}
```

I noticed a lot of panics from the `make_raw_string` assist while working on another issue today.

Co-authored-by: Alexander Elís Ebenesersson <alex2789@gmail.com>
crates/ra_assists/src/assists/raw_string.rs