+4
-4
crates/my_crate/src/lib.rs
+4
-4
crates/my_crate/src/lib.rs
···
19
19
///
20
20
/// assert_eq!(greet("Bob"), String::from("Hello Bob!"));
21
21
/// ```
22
-
pub fn greet(name: &str) -> String {
22
+
pub fn greeting(name: &str) -> String {
23
23
format!("Hello {}!", name)
24
24
}
25
25
26
26
#[cfg(test)]
27
27
mod tests {
28
-
use crate::greet;
28
+
use crate::greeting;
29
29
30
30
#[test]
31
31
fn greet_bob() {
32
-
assert_eq!(greet("Bob"), String::from("Hello Bob!"));
32
+
assert_eq!(greeting("Bob"), String::from("Hello Bob!"));
33
33
}
34
34
35
35
#[test]
36
36
fn greet_the_world() {
37
-
assert_eq!(greet("World"), String::from("Hello World!"));
37
+
assert_eq!(greeting("World"), String::from("Hello World!"));
38
38
}
39
39
}