From 45cbb67a2641cb34e59209b0e86e422e9fa3df1c Mon Sep 17 00:00:00 2001 From: evuez Date: Sun, 7 May 2017 10:40:25 +0200 Subject: [PATCH] Add shorter swap syntax for Rust --- markup/rust | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/markup/rust b/markup/rust index 0bdb50d..b1d0d3c 100644 --- a/markup/rust +++ b/markup/rust @@ -89,10 +89,7 @@ i = 3;||var i = 0 _ i = 3|| || ||[[# parallel-assignment]][#parallel-assignment-note parallel assignment]||##gray|@@//@@ only in variable definition:## _ let (m, n) = (3, 7);||var (m, n) = (3, 7)|| val (m, n) = (3, 7) || -||[[# swap]][#swap-note swap]||let tmp; _ -tmp = x; _ -x = y; _ -y = tmp;||(x, y) = (y, x)|| || +||[[# swap]][#swap-note swap]||let (x, y) = (y, x);||(x, y) = (y, x)|| || ||[[# compound-assignment]][#compound-assignment-note compound assignment]||##gray|//arithmetic://## _ += -= *= /= %= _ _ @@ -2020,4 +2017,4 @@ As of June 2014, to use Swift one must download and install a beta version of Xc $ sudo xcode-select -s /Applications/Xcode6-Beta.app/Contents/Developer/ $ xcrun swift -[[/code]] \ No newline at end of file +[[/code]]