Auto merge of #12258 - izgzhen:remove-data-slice, r=Manishearth

Remove DataSlice, fix #12249

r? @Manishearth

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #12249

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12258)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-07-05 06:24:46 -07:00 committed by GitHub
commit 87c7772527
12 changed files with 61 additions and 163 deletions

View file

@ -324,9 +324,9 @@ impl HTMLFormElement {
content_disposition,
content_type));
let slice = f.upcast::<Blob>().get_slice_or_empty();
let bytes = &f.upcast::<Blob>().get_bytes().unwrap_or(vec![])[..];
let decoded = encoding.decode(&slice.get_bytes(), DecoderTrap::Replace)
let decoded = encoding.decode(bytes, DecoderTrap::Replace)
.expect("Invalid encoding in file");
result.push_str(&decoded);
}