]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #19252 : japaric/rust/cow, r=aturon
authorbors <bors@rust-lang.org>
Wed, 26 Nov 2014 12:02:16 +0000 (12:02 +0000)
committerbors <bors@rust-lang.org>
Wed, 26 Nov 2014 12:02:16 +0000 (12:02 +0000)
- Add `IntoCow` trait, and put it in the prelude
- Add `is_owned`/`is_borrowed` methods to `Cow`
- Add `CowString`/`CowVec` type aliases (to `Cow<'_, String, str>`/`Cow<'_, Vec, [T]>` respectively)
- `Cow` implements: `Show`, `Hash`, `[Partial]{Eq,Ord}`
- `impl BorrowFrom<Cow<'a, T, B>> for B`

[breaking-change]s:

- `IntoMaybeOwned` has been removed from the prelude
- libcollections: `SendStr` is now an alias to `CowString<'static>` (it was aliased to `MaybeOwned<'static>`)
- libgraphviz:
  - `LabelText` variants now wrap `CowString` instead of `MaybeOwned`
  - `Nodes` and `Edges` are now type aliases to `CowVec` (they were aliased to `MaybeOwnedVec`)
- libstd/path: `Display::as_maybe_owned` has been renamed to `Display::as_cow` and now returns a `CowString`
- These functions now accept/return `Cow` instead of `MaybeOwned[Vector]`:
  - libregex: `Replacer::reg_replace`
  - libcollections: `str::from_utf8_lossy`
  - libgraphviz: `Id::new`, `Id::name`, `LabelText::pre_escaped_content`
  - libstd: `TaskBuilder::named`

r? @aturon

1  2 
src/librustc/middle/borrowck/graphviz.rs