feat: add reversing

This commit is contained in:
John Doe 2025-02-27 20:18:30 +01:00 committed by John Doe
parent 424a5957d3
commit ff5d128399
2 changed files with 12 additions and 4 deletions

7
Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "reve-rs"
version = "0.1.0"

View File

@ -1,14 +1,15 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
pub fn reverse_string(input: &str) -> String {
input.chars().rev().collect()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
let result = reverse_string("aezakmi");
assert_eq!(result, "imkazea");
}
}