parth10606_first_crate 0.1.1

A test lib for publishing
Documentation
/// Reverses the characters in a string slice and returns the result as a `String`.
///
/// # Arguments
///
/// * `input` - A string slice (`&str`) to be reversed.
///
/// # Returns
///
/// * A new `String` containing the characters of `input` in reverse order.
///
/// # Examples
///
/// ```
/// use parth10606_first_crate::utils::string;
/// 
/// let original = "hello";
/// let reversed = string::reverse(original);
/// assert_eq!(reversed, "olleh");
/// ```
pub fn reverse(input:&str)->String{
    return input.chars().rev().collect();
}


#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_reverse() {
        assert_eq!(reverse("rust"), "tsur");
    }
}