danielhenrymantilla / rust-uninit

Read trait fixed to soundly work with uninitalized memory
MIT License
25 stars 2 forks source link

Improve ergonomics for `Out<[T; N]>` #31

Open kupiakos opened 10 months ago

kupiakos commented 10 months ago

Most notably, it doesn't have the Deref that Out<[T]> does, so it doesn't get len and friends. Unfortunately I tried adding Deref into #29 and this caused a large series of type ambiguities, enough that it makes the library much less ergonomic.

The simplest option here is to just duplicated the most desired methods available in Out<[T]> as inherent methods. I'm thinking:

Ideally though the get_out and get_out_unchecked are both provided through a shared fn because of the improved documentation.