Transposing characters in a string
If it's just ASCII, treat it as a byte array all the way until the end. Vec has a swap method and you can reconstruct a String from the bytes.
Use map and collect instead of allocating a Vec and manually pushing.
There's no need to allocate a String to pass to &amp;str.




fn transposes(s: &amp;str) -&gt; Vec&lt;String&gt; {
    let bytes = s.as_bytes();

    (1..bytes.len()).map(|i| {
        let mut transpose = bytes.to_owned();
        transpose.swap(i - 1, i);
        String::from_utf8(transpose).expect("Invalid UTF-8")
    }).collect()
}

fn main() {
    println!("{:?}", transposes("maxi"));
}




Even better, if your data is ASCII, encode that in the type system:

extern crate ascii;

use ascii::{AsciiStr, AsciiString};

fn transposes(s: &amp;AsciiStr) -&gt; Vec&lt;AsciiString&gt; {
    (1..s.len()).map(|i| {
        let mut transpose = s.to_owned();
        transpose.as_mut_slice().swap(i - 1, i);
        transpose
    }).collect()
}

fn main() {
    let s = AsciiStr::from_ascii("maxi").expect("Not ASCII");
    println!("{:?}", transposes(s));
}


Note that the transposes function can no longer fail due to invalid strings.