aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-11-15 15:30:21 +0000
committerSeivan Heidari <[email protected]>2019-11-15 15:30:21 +0000
commitcb26df950699586b314731fb70786e0db8eaa049 (patch)
tree29a1fd853757824572bfebc956d20458d827926f /docs
parentc622413bc72ea56d5f62a16788d897cb61eca948 (diff)
parentc6f05abfbbfa2fd1ff06e1adeea7885151aaa768 (diff)
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'docs')
-rw-r--r--docs/user/assists.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md
index 303353e74..8da7578e2 100644
--- a/docs/user/assists.md
+++ b/docs/user/assists.md
@@ -150,6 +150,27 @@ use std::collections::HashMap;
150fn process(map: HashMap<String, String>) {} 150fn process(map: HashMap<String, String>) {}
151``` 151```
152 152
153## `add_new`
154
155Adds a new inherent impl for a type.
156
157```rust
158// BEFORE
159struct Ctx<T: Clone> {
160 data: T,┃
161}
162
163// AFTER
164struct Ctx<T: Clone> {
165 data: T,
166}
167
168impl<T: Clone> Ctx<T> {
169 fn new(data: T) -> Self { Self { data } }
170}
171
172```
173
153## `apply_demorgan` 174## `apply_demorgan`
154 175
155Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws). 176Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws).