]> git.lizzy.rs Git - rust.git/commit
Updated maybe_owned_vec with review feedback.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Thu, 1 May 2014 13:17:36 +0000 (15:17 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Fri, 2 May 2014 15:45:17 +0000 (17:45 +0200)
commit4a122a3185d77cf716dc52d2f54a0595cbccf861
treedfbf6dedfbe40618fedb99405410b67c222fd3bf
parentb7374182f7298183f261a0905ac10f5c8c9701ad
Updated maybe_owned_vec with review feedback.

Namely:

 * Added conversion traits both to and from the various vector types,
   analogous to how `str::MaybeOwned` works with `str::IntoMaybeOwned`
   and `str::Str`.  This led me to add the `FixedLen` variant of
   `MaybeOwnedVector` for interoperability with `std::slice`.

 * Revised client example code to make use of `into_maybe_owned`

 * Added implementations of `Show` and `CloneableVector` for
   `MaybeOwnedVector`.

 * As suggested by kballard, added `into_vec` method that is analogous
   to `CloneableVector::into_owned` except it produces a `Vec` rather
   than a `~[T]`.
src/libgraphviz/lib.rs
src/libgraphviz/maybe_owned_vec.rs