Created
May 5, 2021 02:23
-
-
Save Shaun289/9d994e749dc2985f056f9b441f946cc3 to your computer and use it in GitHub Desktop.
Rust Study : structure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://rinthel.github.io/rust-lang-book-ko/ch05-02-example-structs.html | |
#[derive(Debug)] | |
struct Rectangle { | |
width: u32, | |
height: u32 | |
} | |
fn main() { | |
let rect1 = Rectangle { width:50, height:30 }; | |
println!("{:#?}", rect1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment