diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-19 23:27:55 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-19 23:27:55 +0100 |
commit | e94d7c124ffae5c7409b560e29a6cee006edf401 (patch) | |
tree | 72b770193eb81853cab75a97e19d46eba12c44d8 /docs/user | |
parent | 1bc1f28bc58b2dbcf8f8f548c277e2c90e3075cd (diff) | |
parent | 80545e5d3a72ef05a77ff9584234f030c69bfe9f (diff) |
Merge #4518
4518: New assist: add turbo fish r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/assists.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index 41c5df528..c72b50a4d 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -203,6 +203,24 @@ impl<T: Clone> Ctx<T> { | |||
203 | 203 | ||
204 | ``` | 204 | ``` |
205 | 205 | ||
206 | ## `add_turbo_fish` | ||
207 | |||
208 | Adds `::<_>` to a call of a generic method or function. | ||
209 | |||
210 | ```rust | ||
211 | // BEFORE | ||
212 | fn make<T>() -> T { todo!() } | ||
213 | fn main() { | ||
214 | let x = make┃(); | ||
215 | } | ||
216 | |||
217 | // AFTER | ||
218 | fn make<T>() -> T { todo!() } | ||
219 | fn main() { | ||
220 | let x = make::<${0:_}>(); | ||
221 | } | ||
222 | ``` | ||
223 | |||
206 | ## `apply_demorgan` | 224 | ## `apply_demorgan` |
207 | 225 | ||
208 | Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws). | 226 | Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws). |