diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-06 17:04:47 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-06 17:04:47 +0100 |
commit | fbc8bd3fdbbeed199901d6f387ab57d82aac6e04 (patch) | |
tree | 1817e29c0da2455f898d611e38914ff14cace26c /docs/user/assists.md | |
parent | e99447ffbf77b17674dc047e5a9f5aff9480ed1c (diff) | |
parent | 51c02ab84f6b88ba39e2d0a3ed22bea51114b05a (diff) |
Merge #4043
4043: add Ok wrapping assist #3907 r=matklad a=bnjjj
About issue #3907
close #3907
Co-authored-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'docs/user/assists.md')
-rw-r--r-- | docs/user/assists.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index ee515949e..692fd4f52 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -241,6 +241,18 @@ fn main() { | |||
241 | } | 241 | } |
242 | ``` | 242 | ``` |
243 | 243 | ||
244 | ## `change_return_type_to_result` | ||
245 | |||
246 | Change the function's return type to Result. | ||
247 | |||
248 | ```rust | ||
249 | // BEFORE | ||
250 | fn foo() -> i32┃ { 42i32 } | ||
251 | |||
252 | // AFTER | ||
253 | fn foo() -> Result<i32, > { Ok(42i32) } | ||
254 | ``` | ||
255 | |||
244 | ## `change_visibility` | 256 | ## `change_visibility` |
245 | 257 | ||
246 | Adds or changes existing visibility specifier. | 258 | Adds or changes existing visibility specifier. |