works on Rust where slices don't implement FromIterator