Base64 string ↔ float array
You should use iterators: when you use a line like this for i in 0..dest_len as isize, the compiler cannot optimize when going through the slice.

A better example:

fn read_float_vec_from_byte_vec(v: Vec&lt;u8&gt;) -&gt; Result&lt;Vec&lt;f32&gt;, &amp;'static str&gt; {
    #[inline(always)]
    fn float_from_u8_slice(s: &amp;[u8]) -&gt; f32 {
        let array = [s[0], s[1], s[2], s[3]];
        unsafe { std::mem::transmute(array) }
    }

    match v.len() % 4 {
        0 =&gt; Ok(v.chunks(4).map(float_from_u8_slice).collect()),
        _ =&gt; Err("Number not divisible by 4"),
    }
}


With the iteration over v.chunks(4).map(float_from_u8_slice).collect(), the code is smaller and more readable. Generally speaking, iterators are always better than indexing because indexing operation performs bounds checks.

Unfortunately, you cannot do the same with float_vec_as_byte_vec because (for now) arrays in Rust are not a first-class citizen. Due to the fact that genericity on integers does not exist, you cannot consume an array into an iterator. If it did, we could write something like:

// This code does not work currently
fn float_vec_as_byte_vec(s: &amp;[f32]) -&gt; Vec&lt;u8&gt; {
    s.iter().flat_map(|&amp;f| unsafe { transmute::&lt;f32, [u8; 4]&gt;(f)).collect()
}


In this code, I accept the type &amp;[f32], instead of &amp;Vec&lt;f32&gt;. Slices are a view of memory, and that is what we want. &amp;Vec&lt;f32&gt; does not really make sense, semantically.

In the first function I rewrote, I used &amp;'static str and not String because we do not need an allocated string since it is literal.