<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/ffi, branch 1.52.1</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.52.1</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.52.1'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2021-03-14T04:07:28+00:00</updated>
<entry>
<title>Rollup merge of #82121 - lopopolo:pathbuf-osstring-extend, r=joshtriplett</title>
<updated>2021-03-14T04:07:28+00:00</updated>
<author>
<name>Yuki Okushi</name>
<email>huyuumi.dev@gmail.com</email>
</author>
<published>2021-03-14T04:07:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=67bc866e5934e19c37fd7a115cdc8142fcb8c51d'/>
<id>urn:sha1:67bc866e5934e19c37fd7a115cdc8142fcb8c51d</id>
<content type='text'>
Implement Extend and FromIterator for OsString

Add the following trait impls:

- `impl Extend&lt;OsString&gt; for OsString`
- `impl&lt;'a&gt; Extend&lt;&amp;'a OsStr&gt; for OsString`
- `impl FromIterator&lt;OsString&gt; for OsString`
- `impl&lt;'a&gt; FromIterator&lt;&amp;'a OsStr&gt; for OsString`

Because `OsString` is a platform string with no particular semantics, concatenating them together seems acceptable.

I came across a use case for these trait impls in https://github.com/artichoke/artichoke/pull/1089:

Artichoke is a Ruby interpreter. Its CLI accepts multiple `-e` switches for executing inline Ruby code, like:

```console
$ cargo -q run --bin artichoke -- -e '2.times {' -e 'puts "foo: #{__LINE__}"' -e '}'
foo: 2
foo: 2
```

I use `clap` for command line argument parsing, which collects these `-e` commands into a `Vec&lt;OsString&gt;`. To pass these commands to the interpreter for `Eval`, I need to join them together. Combining these impls with `Iterator::intersperse` https://github.com/rust-lang/rust/issues/79524 would enable me to build a single bit of Ruby code.

Currently, I'm doing something like:

```rust
let mut commands = commands.into_iter();
let mut buf = if let Some(command) = commands.next() {
    command
} else {
    return Ok(Ok(()));
};
for command in commands {
    buf.push("\n");
    buf.push(command);
}
```

If there's interest, I'd also like to add impls for `Cow&lt;'a, OsStr&gt;`, which would avoid allocating the `"\n"` `OsString` in the concatenate + intersperse use case.
</content>
</entry>
<entry>
<title>Add impls for iterators of Cow&lt;OsStr&gt;</title>
<updated>2021-03-03T19:52:14+00:00</updated>
<author>
<name>Ryan Lopopolo</name>
<email>rjl@hyperbo.la</email>
</author>
<published>2021-03-03T19:52:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=05ea200213fe30967fff38ebac887c52803aabd5'/>
<id>urn:sha1:05ea200213fe30967fff38ebac887c52803aabd5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Convert primitives to use intra-doc links</title>
<updated>2021-02-26T01:31:53+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jyn514@gmail.com</email>
</author>
<published>2020-12-19T13:23:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9a75f4fed10a65e6cb779fc059f272deadd7ecc1'/>
<id>urn:sha1:9a75f4fed10a65e6cb779fc059f272deadd7ecc1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #82128 - anall:feature/add_diagnostic_items, r=davidtwco</title>
<updated>2021-02-23T01:51:51+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>dylan.dpc@gmail.com</email>
</author>
<published>2021-02-23T01:51:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b8d4354099a070fa34bdf373e0f2ae2e40797ee9'/>
<id>urn:sha1:b8d4354099a070fa34bdf373e0f2ae2e40797ee9</id>
<content type='text'>
add diagnostic items for OsString/PathBuf/Owned as well as to_vec on slice

This is adding diagnostic items to be used by rust-lang/rust-clippy#6730, but my understanding is the clippy-side change does need to be done over there since I am adding a new clippy feature.

Add diagnostic items to the following types:
  OsString (os_string_type)
  PathBuf (path_buf_type)
  Owned (to_owned_trait)

As well as the to_vec method on slice/[T]
</content>
</entry>
<entry>
<title>Optimize FromIterator&lt;OsString&gt; to reuse the first allocation</title>
<updated>2021-02-16T22:20:26+00:00</updated>
<author>
<name>Ryan Lopopolo</name>
<email>rjl@hyperbo.la</email>
</author>
<published>2021-02-16T22:14:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2fcb8b5c201d22060f1ba46cc2291cacca593e02'/>
<id>urn:sha1:2fcb8b5c201d22060f1ba46cc2291cacca593e02</id>
<content type='text'>
</content>
</entry>
<entry>
<title>a few more diagnostic items</title>
<updated>2021-02-16T02:32:21+00:00</updated>
<author>
<name>Andrea Nall</name>
<email>anall@andreanall.com</email>
</author>
<published>2021-02-16T02:32:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=67fcaaaa7a9c393926e25db600a9976137425d68'/>
<id>urn:sha1:67fcaaaa7a9c393926e25db600a9976137425d68</id>
<content type='text'>
</content>
</entry>
<entry>
<title>requested/proposed changes</title>
<updated>2021-02-15T22:59:47+00:00</updated>
<author>
<name>Andrea Nall</name>
<email>anall@andreanall.com</email>
</author>
<published>2021-02-15T22:58:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c6bb62810ae226b35e0181d8c4efc6d0377d196d'/>
<id>urn:sha1:c6bb62810ae226b35e0181d8c4efc6d0377d196d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add diagnostic items</title>
<updated>2021-02-15T02:27:28+00:00</updated>
<author>
<name>Andrea Nall</name>
<email>anall@andreanall.com</email>
</author>
<published>2021-02-15T02:27:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5ef202520f9c4c87dd6218bbfbbf57587e88f8be'/>
<id>urn:sha1:5ef202520f9c4c87dd6218bbfbbf57587e88f8be</id>
<content type='text'>
Add diagnostic items to the following types:
  OsString (os_string_type)
  PathBuf (path_buf_type)
  Owned (to_owned_trait)

As well as the to_vec method on slice/[T]
</content>
</entry>
<entry>
<title>Implement Extend and FromIterator for OsString</title>
<updated>2021-02-14T23:01:46+00:00</updated>
<author>
<name>Ryan Lopopolo</name>
<email>rjl@hyperbo.la</email>
</author>
<published>2021-02-14T23:01:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3ed618443437307749e4c773f260c2b4b94673f5'/>
<id>urn:sha1:3ed618443437307749e4c773f260c2b4b94673f5</id>
<content type='text'>
Add the following trait impls:

- `impl Extend&lt;OsString&gt; for OsString`
- `impl&lt;'a&gt; Extend&lt;&amp;'a OsStr&gt; for OsString`
- `impl FromIterator&lt;OsString&gt; for OsString`
- `impl&lt;'a&gt; FromIterator&lt;&amp;'a OsStr&gt; for OsString`

Because `OsString` is a platform string with no particular semantics,
concatenating them together seems acceptable.
</content>
</entry>
<entry>
<title>Seal the CommandExt, OsStrExt and OsStringExt traits</title>
<updated>2021-02-10T21:30:30+00:00</updated>
<author>
<name>Amanieu d'Antras</name>
<email>amanieu@gmail.com</email>
</author>
<published>2021-02-10T21:30:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bfd1ccfb271f03aa85488408c3b03a15ad8d7c7f'/>
<id>urn:sha1:bfd1ccfb271f03aa85488408c3b03a15ad8d7c7f</id>
<content type='text'>
</content>
</entry>
</feed>
