Ad
Code
Diff
  • fn reverse(s: &str) -> String {
        s.chars().rev().collect::<String>()
    }
    • fn reverse(s: &str) -> String {
    • s.chars().fold(String::new(), |acc, c| format!("{}{}", c, acc))
    • s.chars().rev().collect::<String>()
    • }