aboutsummaryrefslogtreecommitdiff
path: root/docs/user/assists.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/user/assists.md')
-rw-r--r--docs/user/assists.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md
index a1058ecde..04387e3b0 100644
--- a/docs/user/assists.md
+++ b/docs/user/assists.md
@@ -56,6 +56,24 @@ fn main() {
56} 56}
57``` 57```
58 58
59## `add_from_impl_for_enum`
60
61Adds a From impl for an enum variant with one tuple field.
62
63```rust
64// BEFORE
65enum A { ┃One(u32) }
66
67// AFTER
68enum A { One(u32) }
69
70impl From<u32> for A {
71 fn from(v: u32) -> Self {
72 A::One(v)
73 }
74}
75```
76
59## `add_function` 77## `add_function`
60 78
61Adds a stub function with a signature matching the function under the cursor. 79Adds a stub function with a signature matching the function under the cursor.