flagon-io/hello

public

Greets people from the command line. The sample repository for g1t.

hello/src/lib.rs

16 lines260 bytesCodeBlame

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 line1//! Greetings.
2
3/// The greeting for `name`.
4pub fn greeting(name: &str) -> String {
5 format!("Hello, {name}!")
6}
7
8#[cfg(test)]
9mod tests {
10 use super::*;
11
12 #[test]
13 fn greets_by_name() {
14 assert_eq!(greeting("Ada"), "Hello, Ada!");
15 }
16}