Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Greet people from the command line | 1 | //! Greetings. |
| 2 | ||
| 3 | /// The greeting for `name`. | |
| 4 | pub fn greeting(name: &str) -> String { | |
| 5 | format!("Hello, {name}!") | |
| 6 | } | |
| 7 | ||
| Add a farewell | 8 | /// The farewell for `name`. |
| 9 | pub fn farewell(name: &str) -> String { | |
| 10 | format!("Goodbye {name}!") | |
| 11 | } | |
| 12 | ||
| Greet people from the command line | 13 | #[cfg(test)] |
| 14 | mod tests { | |
| 15 | use super::*; | |
| 16 | ||
| 17 | #[test] | |
| Add a farewell | 18 | fn says_goodbye_by_name() { |
| 19 | assert_eq!(farewell("Ada"), "Goodbye, Ada!"); | |
| 20 | } | |
| 21 | ||
| 22 | #[test] | |
| Greet people from the command line | 23 | fn greets_by_name() { |
| 24 | assert_eq!(greeting("Ada"), "Hello, Ada!"); | |
| 25 | } | |
| 26 | } |