Auto merge of #9684 - danlrobertson:i9655, r=KiChjang

Add methods to move ByteStrings underlying bytes

Add methods to move the underlying `Vec<u8>` for `ByteString`.

I saw this as at least two methods. One to "move and replace with and empty Vec<u8> (`bytes`), and one to take ownership of the whole object (`own_bytes`). I typically also don't like adding methods with out unit tests. If you think they're unnecessary, just let me know.

As always, please let me know if you have any comments, critiques, or nits!

Fixes #9655

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9684)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-02-19 17:21:14 +05:30
commit aae6525f7d
4 changed files with 36 additions and 9 deletions

View file

@ -456,7 +456,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
None => {}
}
headers.set_raw(name_str.to_owned(), vec![value.to_vec()]);
headers.set_raw(name_str.to_owned(), vec![value.into()]);
Ok(())
}