mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-18 18:04:13 +00:00
16 lines
173 B
Rust
16 lines
173 B
Rust
pub struct Foo {
|
|
x: u32,
|
|
}
|
|
|
|
impl Foo {
|
|
pub fn print(&self) {
|
|
println!("{}", self.x);
|
|
}
|
|
}
|
|
|
|
pub fn make_foo(x: u32) -> Foo {
|
|
Foo { x }
|
|
}
|
|
|
|
fn main() {}
|