rust/src/libcollections
bors 83a44c7fa6 auto merge of #19378 : japaric/rust/no-as-slice, r=alexcrichton
Now that we have an overloaded comparison (`==`) operator, and that `Vec`/`String` deref to `[T]`/`str` on method calls, many `as_slice()`/`as_mut_slice()`/`to_string()` calls have become redundant. This patch removes them. These were the most common patterns:

- `assert_eq(test_output.as_slice(), "ground truth")` -> `assert_eq(test_output, "ground truth")`
- `assert_eq(test_output, "ground truth".to_string())` -> `assert_eq(test_output, "ground truth")`
- `vec.as_mut_slice().sort()` -> `vec.sort()`
- `vec.as_slice().slice(from, to)` -> `vec.slice(from_to)`

---

Note that e.g. `a_string.push_str(b_string.as_slice())` has been left untouched in this PR, since we first need to settle down whether we want to favor the `&*b_string` or the `b_string[]` notation.

This is rebased on top of #19167

cc @alexcrichton @aturon
2014-12-08 02:32:31 +00:00
..
btree auto merge of #19378 : japaric/rust/no-as-slice, r=alexcrichton 2014-12-08 02:32:31 +00:00
hash /*! -> //! 2014-11-26 16:50:14 -08:00
tree auto merge of #19378 : japaric/rust/no-as-slice, r=alexcrichton 2014-12-08 02:32:31 +00:00
trie libcollections: remove unnecessary to_string() calls 2014-12-06 23:53:02 -05:00
bench.rs collections: Remove all collections traits 2014-11-01 11:37:04 -07:00
binary_heap.rs libcollections: remove unnecessary as_mut_slice() calls 2014-12-06 23:53:01 -05:00
bit.rs libcollections: remove unnecessary to_string() calls 2014-12-06 23:53:02 -05:00
dlist.rs libcollections: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
enum_set.rs libcollections: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
lib.rs Remove special casing for some meta attributes 2014-11-26 11:44:45 -08:00
macros.rs A few minor documentation fixes 2014-08-19 17:22:18 +12:00
ring_buf.rs libcollections: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
slice.rs libcollections: remove unnecessary to_string() calls 2014-12-06 23:53:02 -05:00
str.rs auto merge of #19378 : japaric/rust/no-as-slice, r=alexcrichton 2014-12-08 02:32:31 +00:00
string.rs libcollections: remove unnecessary to_string() calls 2014-12-06 23:53:02 -05:00
vec_map.rs libcollections: remove unnecessary to_string() calls 2014-12-06 23:53:02 -05:00
vec.rs libcollections: remove unnecessary as_mut_slice() calls 2014-12-06 23:53:01 -05:00