pub fn capitalize_first(input: &str) -> String {
// use std::iter::Iterator;
    let mut c = input.chars();
    match c.next() {
        None => String::new(),
        Some(first) => {
            first.to_uppercase().to_string() + c.as_str()
        }
        // concat!(first.to_uppercase() , c.as_str()),
    }
}
// iterators2.rs
// In this module, you'll learn some of unique advantages that iterators can offer
// Step 1. Complete the `capitalize_first` function to pass the first two cases
// Step 2. Apply the `capitalize_first` function to a vector of strings, ensuring that it returns a vector of strings as well
// Step 3. Apply the `capitalize_first` function again to a list, but try and ensure it returns a single string
// As always, there are hints if you execute `rustlings hint iterators2`!
iterators2.rs
In this module, you'll learn some of unique advantages that iterators can offer
Step 1. Complete the `capitalize_first` function to pass the first two cases
Step 2. Apply the `capitalize_first` function to a vector of strings, ensuring that it returns a vector of strings as well
Step 3. Apply the `capitalize_first` function again to a list, but try and ensure it returns a single string
As always, there are hints if you execute `rustlings hint iterators2`!
iterators2 . rs In this module you ' ll learn some of unique advantages that iterators can offer Step 1 . Complete the ` capitalize_first ` function to pass the first two cases Step 2 . Apply the ` capitalize_first ` function to a vector of strings ensuring that it returns a vector of strings as well Step 3 . Apply the ` capitalize_first ` function again to a list but try and ensure it returns a single string As always there are hints if you execute ` rustlings hint iterators2 ` !
pub fn capitalize_first(input: &str) -> String {
// use std::iter::Iterator;
    let mut c = input.chars();
    match c.next() {
        None => String::new(),
        Some(first) => {
            first.to_uppercase().to_string() + c.as_str()
        }
        // concat!(first.to_uppercase() , c.as_str()),
    }
}
pub fn capitalize_first ( input : & str ) -> String { // use std::iter::Iterator; let mut c = input . chars ( ) ; match c . next ( ) { None => String :: new ( ) , Some ( first ) => { first . to_uppercase ( ) . to_string ( ) + c . as_str ( ) } // concat!(first.to_uppercase() , c.as_str()), } }
iterators2.rs
In this module, you'll learn some of unique advantages that iterators can offer
Step 1.
iterators2 . rs In this module you ' ll learn some of unique advantages that iterators can offer Step 1 .
input
&str
input
&str