14 lines
159 B
Rust
14 lines
159 B
Rust
pub struct Bar {
|
|
x: u32,
|
|
}
|
|
|
|
impl Bar {
|
|
pub fn print(&self) {
|
|
println!("{}", self.x);
|
|
}
|
|
}
|
|
|
|
pub fn make_bar(x: u32) -> Bar {
|
|
Bar { x }
|
|
}
|