Skip to content

Commit b2c5574

Browse files
authored
Create FunctionWithTupleReturn.rs
1 parent dd4886c commit b2c5574

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fn main() {
2+
let (x, y) = swap(10, 20);
3+
println!("Swapped: x={}, y={}", x, y);
4+
}
5+
6+
fn swap(a: i32, b: i32) -> (i32, i32) {
7+
(b, a)
8+
}

0 commit comments

Comments
 (0)