flagon-io
/
hello
/
Code
⌘K
Docs
Sign in
flagon-io
/
hello
public
Greets people from the command line. The sample repository for g1t.
Files
Commits
Branches
(soon)
Tags
(soon)
Compare
(soon)
Docs
(soon)
hello
/
src
/
lib.rs
16 lines
260 bytes
Code
Blame
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
}