diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-20 11:40:15 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-20 11:40:15 +0100 |
commit | b19da133eec13ac8943b708d17410e3a8a6b6193 (patch) | |
tree | 2e1b540b6914c4b7e11b7b51d878a4d45aea859f /docs/user | |
parent | 4101c15ddbae860b86cd2ed17b09b7526ef17de8 (diff) | |
parent | ce4d84365632ea379caa6c79580b1e458dde39f7 (diff) |
Merge #1850
1850: feat(assists): raw string <-> usual string manipulation r=matklad a=Geobert
Fixes #1730
Co-authored-by: Geobert Quach <[email protected]>
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/features.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/user/features.md b/docs/user/features.md index 1034a5117..93e565315 100644 --- a/docs/user/features.md +++ b/docs/user/features.md | |||
@@ -445,6 +445,62 @@ fn foo<T: u32, F: FnOnce(T) -> T>() {} | |||
445 | fn foo<T, F>() where T: u32, F: FnOnce(T) -> T {} | 445 | fn foo<T, F>() where T: u32, F: FnOnce(T) -> T {} |
446 | ``` | 446 | ``` |
447 | 447 | ||
448 | - Make raw string | ||
449 | |||
450 | ```rust | ||
451 | // before: | ||
452 | fn f() { | ||
453 | let s = <|>"abcd"; | ||
454 | } | ||
455 | |||
456 | // after: | ||
457 | fn f() { | ||
458 | let s = <|>r"abcd"; | ||
459 | } | ||
460 | ``` | ||
461 | |||
462 | - Make usual string | ||
463 | |||
464 | ```rust | ||
465 | // before: | ||
466 | fn f() { | ||
467 | let s = <|>r#"abcd"#; | ||
468 | } | ||
469 | |||
470 | // after: | ||
471 | fn f() { | ||
472 | let s = <|>"abcd"; | ||
473 | } | ||
474 | ``` | ||
475 | |||
476 | - Add hash | ||
477 | |||
478 | ```rust | ||
479 | // before: | ||
480 | fn f() { | ||
481 | let s = <|>r"abcd"; | ||
482 | } | ||
483 | |||
484 | // after: | ||
485 | fn f() { | ||
486 | let s = <|>r#"abcd"#; | ||
487 | } | ||
488 | ``` | ||
489 | |||
490 | - Remove hash | ||
491 | |||
492 | ```rust | ||
493 | // before: | ||
494 | fn f() { | ||
495 | let s = <|>r#"abcd"#; | ||
496 | } | ||
497 | |||
498 | // after: | ||
499 | fn f() { | ||
500 | let s = <|>r"abcd"; | ||
501 | } | ||
502 | ``` | ||
503 | |||
448 | ### Magic Completions | 504 | ### Magic Completions |
449 | 505 | ||
450 | In addition to usual reference completion, rust-analyzer provides some ✨magic✨ | 506 | In addition to usual reference completion, rust-analyzer provides some ✨magic✨ |