Pig Latin exercise in Rust
For overall issues, these jump out:


s[i].is_alphabetic() &amp;&amp; i &lt; s.len() can panic, because you access the value before checking the length, it would have to be i &lt; s.len() &amp;&amp; s[i].is_alphabetic().
is_alphabetic considers lots of things alphabetic that you probably don't want. If you look at the docs the examples include assert!('京'.is_alphabetic()); which probably isn't what you want.


For Rust itself:


Rather than converting the string to a vector of chars, it's easier to use an iterator. In your case it needs to be an iterator that can .peek so you can stop before consuming the character.
Pattern-matching can make the readability of checking the vowels vs others easier, and it allows you to collapse the logic in your first if. The matches also allow you to cleanly create and define the suffix value earlier, and avoid the usage of the problematic is_alphabetic function.


Here's an updated implementation:

let mut chars = input.chars().peekable();
let mut new_s = String::new();
while let Some(c) = chars.next() {
    let suffix = match c {
        'a' | 'e' | 'i' | 'o' | 'u' =&gt; {
            new_s.push(c);
            String::from("-hay")
        }
        'a'...'z' | 'A'...'Z' =&gt; {
            format!("-{}ay", c)
        }
        _ =&gt; {
            new_s.push(c);
            continue;
        }
    };

    while let Some(&amp;c) = chars.peek() {
        match c {
            'a'...'z' | 'A'...'Z' =&gt; {
                chars.next();
                new_s.push(c);
            }
            _ =&gt; break,
        }
    }

    new_s += &amp;suffix;
}
println!("{}", new_s);