We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7af3077 commit da295d0Copy full SHA for da295d0
1 file changed
Function/FunctionReturningStruct.rs
@@ -0,0 +1,13 @@
1
+struct Point {
2
+ x: i32,
3
+ y: i32,
4
+}
5
+
6
+fn main() {
7
+ let point = create_point(10, 20);
8
+ println!("Point: ({}, {})", point.x, point.y);
9
10
11
+fn create_point(x: i32, y: i32) -> Point {
12
+ Point { x, y }
13
0 commit comments