Skip to content

Commit 7de60bc

Browse files
authored
Create DefaultReturnValue.rs
1 parent 5666a31 commit 7de60bc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Function/DefaultReturnValue.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fn main() {
2+
let result = default_value();
3+
println!("Default value: {}", result);
4+
}
5+
6+
fn default_value() -> i32 {
7+
42 // No semicolon means this is the returned value
8+
}

0 commit comments

Comments
 (0)