rust/library/std/src/sys_common
Matthias Krüger 3964bb131b
Rollup merge of #137155 - thaliaarchi:wtf8-organize, r=ChrisDenton
Organize `OsString`/`OsStr` shims

Synchronize the `bytes.rs` and `wtf8.rs` shims for `OsString`/`OsStr` so they're easier to diff between each other. This is mostly ordering items the same between the two. I tried to minimize moves and went for the average locations between the files.

With them in the same order, it is clear that `FromInner<_>` is not implemented for `bytes::Buf` and `Clone::clone_from` is not implemented for `wtf8::Buf`, but they are for the other. Fix that.

I added #[inline] to all inherent methods of the `OsString`/`OsStr` shims, because it seemed that was already the rough pattern. `bytes.rs` has more inlining than `wtf8.rs`, so I added the corresponding ones to `wtf8.rs`. Then, the common missing ones have no discernible pattern to me. They're not divided by non-allocating/allocating. Perhaps the pattern is that UTF-8 validation isn't inlined? Since these types are merely the inner values in `OsStr`/`OsString`, I put inline on all methods and let those public types dictate inlining. I have not inspected codegen or run benchmarks.

Also, touch up some (private) documentation comments.

r? ``````@ChrisDenton``````
2025-02-19 21:16:12 +01:00
..
wtf8 Rustfmt 2025-02-08 22:12:13 +00:00
fs.rs std: update internal uses of io::const_error! 2024-11-26 18:38:24 +01:00
mod.rs std: get rid of sys_common::io 2025-02-07 16:54:07 +01:00
process.rs Use #[derive(Default)] instead of manually implementing it 2024-12-23 03:01:29 +00:00
tests.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
wstr.rs Fix doc nits 2024-07-26 13:26:33 +01:00
wtf8.rs Rollup merge of #137155 - thaliaarchi:wtf8-organize, r=ChrisDenton 2025-02-19 21:16:12 +01:00