Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6b106ab

Browse files
structs5.rs added
1 parent 78cb9a7 commit 6b106ab

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//Using field init shorthand syntax to reduce repetitions.
2+
/*
3+
/ Fill the blank
4+
struct Person {
5+
name: String,
6+
age: u8,
7+
}
8+
fn main() {
9+
println!("Success!");
10+
}
11+
12+
fn build_person(name: String, age: u8) -> Person {
13+
Person {
14+
age,
15+
__
16+
}
17+
}
18+
*/

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /