Use ArrayVec rather than Vec for Device ports()
The current code allocates from the heap after already allocating from the stack a suitably sized array. This is inefficient but also unnecessary. Allocating Vecs in library code, as a general principal, should be avoided if at all possible, and, if absolutely necessary, it would be nice to be able to capture failed allocation. It's a long standing source of problems in long-running processes.
I thinking about this when merge ports method. But as said I want keep dependence small as possible. Use crate for only single function it's too expensive
Expensive? I don't think you mean that. Admittedly, ArrayVec doesn't yet have a 1.0 release. If you're reluctant to add this, then could you let me pass in a [MaybeUninit