Skip to content

Commit af5396c

Browse files
Rust Functions
Rust Functions create and call with Parameters Passing
1 parent ffb5b47 commit af5396c

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

data/rust.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,23 @@
174174
"code": "(i32, f64, u8)"
175175
}
176176
]
177+
},
178+
{
179+
"title": "Function",
180+
"items": [
181+
{
182+
"definition": "Main Function",
183+
"code": "fn main() {\n\tprintln!(\"Hello, world!\");\n}"
184+
},
185+
{
186+
"definition": "Create Custom Function",
187+
"code": "fn function_name() {\n\t//code area\n"
188+
},
189+
{
190+
"definition": "Function call with Parameters Passing",
191+
"code": "fn main() {\n\tanother_function(5);\n}\n\nfn another_function(x: i32) {\n\tprintln!(\"The value of x is: {x}\");\n"
177192
}
193+
]
194+
}
178195
]
179-
}
196+
}

0 commit comments

Comments
 (0)