Inline Windows OsStrExt::encode_wide
by nvzqz · Pull Request #97841 · rust-lang/rust (original) (raw)
Inlining iterator constructors does tend to be beneficial, as it's required to constant fold anything having to do with the iterator, and allows propagation of checks (for example, if a length check exists prior to construction of the iterator, the compiler only knows that continues to hold if the construction of the iterator is inlined). They also tend to be small, as this one looks to be.
As a non-generic stdlib function, I wouldn't expect this to get inlined without this, and it doesn't https://rust.godbolt.org/z/4xf8d1T6h. So I think this is fine, and am going to accept it.
@bors r+