km_crates_publish_test/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub fn reverse(input: impl Into<String>) -> String {
    let s: String = input.into();

    s.chars().rev().collect::<String>()
}

#[cfg(test)]
mod tests {
    use crate::reverse;

    #[test]
    fn it_works() {
        assert_eq!("fotsirk", reverse("kristof"));
    }
}