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 bbbb450

Browse files
Structs8.rs Completed
1 parent 4a52a24 commit bbbb450

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
509 KB
Binary file not shown.

‎5. Compound Data Types/5.5 Structs/structs8.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,19 @@ fn main() {
1818
println!("{}, {}, {:?}",f.name, f.data, f);
1919
}
2020
*/
21+
#[derive(Debug)]
22+
struct File {
23+
name: String,
24+
data: String,
25+
}
26+
fn main() {
27+
let f = File {
28+
name: String::from("readme.md"),
29+
data: "Rust By Practice".to_string(),
30+
};
31+
32+
let _name = f.name;
33+
34+
// ONLY modify this line
35+
println!("{}", f.data);
36+
}

0 commit comments

Comments
(0)

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