easier 0.3.0

making rust easier
Documentation
pub trait ToStringsExtension {
    /// Converts a slice of string slices to a vector of strings.
    /// e.g. instead of  
    /// ```rust
    /// ["1".to_string(), "2".to_string(), "3".to_string()];
    /// ```
    /// you can do
    /// ```rust
    /// use easier::prelude::*;
    /// ["1", "2", "3"].strings();
    /// ```
    fn strings(&self) -> Vec<String>;
}

impl ToStringsExtension for [&str] {
    fn strings(&self) -> Vec<String> {
        self.iter().map(|s| s.to_string()).collect()
    }
}

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

    #[test]
    fn strings() {
        let vec: Vec<String> = ["1", "2", "3"].strings();
        assert_eq!(
            vec,
            vec!["1", "2", "3"]
                .iter()
                .map(|s| s.to_string())
                .collect::<Vec<String>>()
        );
    }
}