rust_docker_sample/
lib.rs

1//! This is a first-step crate.
2
3#![crate_name = "rust_docker_sample"]
4
5/// Returns an string which has same value with an arugment msg.
6///
7/// # Arguments
8/// * `msg` - A string slice
9///
10/// # Examples
11///
12/// ```
13/// use rust_docker_sample::echo;
14/// let msg: &str = "msg...";
15/// let echo_msg = echo(msg);
16///```
17///
18pub fn echo(msg: &str) -> String {
19    String::from(msg)
20}
21
22#[cfg(test)]
23mod tests {
24    use crate::echo;
25
26    #[test]
27    fn test_echo() {
28        let msg: &str = "yo man";
29        let echo_msg = echo(msg);
30        assert!(echo_msg == "yo man");
31    }
32}