]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #85001 - CDirkx:bytestring, r=JohnTitor
authorYuki Okushi <jtitor@2k36.org>
Fri, 2 Jul 2021 18:15:09 +0000 (03:15 +0900)
committerGitHub <noreply@github.com>
Fri, 2 Jul 2021 18:15:09 +0000 (03:15 +0900)
commitfb736d96c33702f1aabac4092003c412c1d9d00a
tree63141520596cbabde8ff5570538e8056322011eb
parent45470a3bcd9f26017bcdbf4d5ae07be0d922ce93
parent059008f0334fc3086f541da3c1e5729cc7b53a7c
Rollup merge of #85001 - CDirkx:bytestring, r=JohnTitor

Merge `sys_common::bytestring` back into `os_str_bytes`

`bytestring` contains code for correctly debug formatting a byte slice (`[u8]`). This functionality is and has historically only been used to provide the debug formatting of byte-based os-strings (on unix etc.).

Having this functionality in the separate `bytestring` module was useful in the past to reduce duplication, as [when it was added](https://github.com/rust-lang/rust/pull/46798) `os_str_bytes` was still split into `sys::{unix, redox, wasi, etc.}::os_str`. However, now that is no longer the case, there is not much reason for the `bytestring` functionality to be separate from `os_str_bytes`; I don't think it is very likely that another part of std will need to handle formatting byte strings that are not os-strings in the future (everything should be `utf8`). This is why this PR merges the functionality of `bytestring` directly into the debug implementation in `os_str_bytes`.