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 | ||
| 8 | #[cfg(test)] | |
| 9 | mod tests { | |
| 10 | use super::*; | |
| 11 | ||
| 12 | #[test] | |
| 13 | fn greets_by_name() { | |
| 14 | assert_eq!(greeting("Ada"), "Hello, Ada!"); | |
| 15 | } | |
| 16 | } |