Datasets:

Modalities:
Text
Formats:
text
Size:
< 1K
Libraries:
Datasets
License:
PyRs2 / rust /person.rs
khulnasoft's picture
Upload folder using huggingface_hub
998b6cc verified
raw
history blame contribute delete
353 Bytes
struct Person {
name: String,
age: u32,
}
impl Person {
fn new(name: String, age: u32) -> Person {
Person { name, age }
}
fn greet(&self) {
println!("Hello, my name is {} and I am {} years old.", self.name, self.age);
}
}
fn main() {
let person = Person::new("Alice".to_string(), 30);
person.greet();
}