#[test] fn test_foo() { println!("The answer to life, the universe and everything"); assert_eq!(foo(), 42); }
- #[test]
- fn test_foo() {
println!("qwerty");println!("asdfgh");assert_eq!(foo(), 1);- println!("The answer to life, the universe and everything");
- assert_eq!(foo(), 42);
- }
struct Person { first_name: String, last_name: String, } impl Person { fn new(first_name: String, last_name: String) -> Self { Person { first_name, last_name, } } fn greet(&self) -> String { format!("Hello, my name is {} {}", self.first_name, self.last_name) } }
- struct Person {
first_name: String,last_name: String,- first_name: String,
- last_name: String,
- }
- impl Person {
- fn new(first_name: String, last_name: String) -> Self {
Person {first_name, last_name}- Person {
- first_name,
- last_name,
- }
- }
- fn greet(&self) -> String {
- format!("Hello, my name is {} {}", self.first_name, self.last_name)
- }
- }