]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #96881 - est31:join_osstr, r=dtolnay
authorbors <bors@rust-lang.org>
Tue, 31 May 2022 04:28:29 +0000 (04:28 +0000)
committerbors <bors@rust-lang.org>
Tue, 31 May 2022 04:28:29 +0000 (04:28 +0000)
commit989b806f61cf12840ddcd8b2bf16d6bef055bd01
tree27f4e3fa284a927575046a9ef6e6b268977e654a
parent47365c0d656e2e55d1b6b9dad92842540e3ed1af
parentcb60e70dc4a066247b0081782db56807386eaf58
Auto merge of #96881 - est31:join_osstr, r=dtolnay

Implement [OsStr]::join

Implements join for `OsStr` and `OsString` slices:

```Rust
    let strings = [OsStr::new("hello"), OsStr::new("dear"), OsStr::new("world")];
    assert_eq!("hello dear world", strings.join(OsStr::new(" ")));
````

This saves one from converting to strings and back, or from implementing it manually.

This PR has been re-filed after #96744 was first accidentally merged and then reverted.

The change is instantly stable and thus:

r? rust-lang/libs-api `@rustbot` label +T-libs-api -T-libs

cc `@thomcc` `@m-ou-se` `@faptc`
library/std/src/ffi/os_str.rs
library/std/src/lib.rs