mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
commit
aae6525f7d
4 changed files with 36 additions and 9 deletions
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue