]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #34890 - oconnor663:addassign, r=brson
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 21 Jul 2016 09:27:00 +0000 (11:27 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Jul 2016 09:27:00 +0000 (11:27 +0200)
commit4817c5e53d18897d9c851dffc293d6ac3d7fecdf
treebeade6b2dbb0028e30819e340dddc6202d7dd478
parent9ba1792aac8b01a313c87611a2525a87a6606bc3
parent9b8130666de569d6d27332d42df43859a57b3e72
Rollup merge of #34890 - oconnor663:addassign, r=brson

implement AddAssign for String

Currently `String` implements `Add` but not `AddAssign`. This PR fills in that gap.

I played around with having `AddAssign` (and `Add` and `push_str`) take `AsRef<str>` instead of `&str`, but it looks like that breaks arguments that implement `Deref<Target=str>` and not `AsRef<str>`. Comments in [`libcore/convert.rs`](https://github.com/rust-lang/rust/blob/master/src/libcore/convert.rs#L207-L213) make it sound like we could fix this with a blanket impl eventually. Does anyone know what's blocking that?
src/libcollections/string.rs