diff options
| author | Marcus Klaas <mail@marcusklaas.nl> | 2016-05-09 20:11:25 +0200 |
|---|---|---|
| committer | Marcus Klaas <mail@marcusklaas.nl> | 2016-05-12 21:15:06 +0200 |
| commit | cd158cecc87cb2d4d63aecf8854952370cb9ea4b (patch) | |
| tree | 8d1cc8700cd73e5892d7bb8208ee067d5c3a2dbb /tests/source | |
| parent | ee7b5805fcb1e4bc6334b7a6a814769d4606541d (diff) | |
Add try macro to try shorthand conversion tests
Diffstat (limited to 'tests/source')
| -rw-r--r-- | tests/source/chains.rs | 4 | ||||
| -rw-r--r-- | tests/source/try-conversion.rs | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/source/chains.rs b/tests/source/chains.rs index 8ec5cd191c5..48de948865b 100644 --- a/tests/source/chains.rs +++ b/tests/source/chains.rs @@ -120,4 +120,8 @@ fn try_shorthand() { let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test(); let zzzz = expr?.another?.another?.another?.another?; let aaa = x ???????????? ?????????????? ???? ????? ?????????????? ????????? ?????????????? ??; + + let y = a.very .loooooooooooooooooooooooooooooooooooooong() .chain() + .inside() .weeeeeeeeeeeeeee()? .test() .0 + .x; } diff --git a/tests/source/try-conversion.rs b/tests/source/try-conversion.rs new file mode 100644 index 00000000000..addf2f5d5e8 --- /dev/null +++ b/tests/source/try-conversion.rs @@ -0,0 +1,11 @@ +// rustfmt-use_try_shorthand: true + +fn main() { + let x = try!(some_expr()); + + let y = try!(a.very.loooooooooooooooooooooooooooooooooooooong().chain().inside().weeeeeeeeeeeeeee()).test().0.x; +} + +fn test() { + a? +} |
