mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Call from_base64 on a vector slice rather than a string slice (fixes #2877).
This commit is contained in:
parent
97e068b1c2
commit
dbefb2f0fd
1 changed files with 1 additions and 4 deletions
|
@ -66,10 +66,7 @@ fn load(load_data: LoadData, start_chan: Sender<LoadResponse>) {
|
|||
// FIXME(#2909): It’s unclear what to do with non-alphabet characters,
|
||||
// but Acid 3 apparently depends on spaces being ignored.
|
||||
let bytes = bytes.move_iter().filter(|&b| b != ' ' as u8).collect::<Vec<u8>>();
|
||||
// FIXME(#2877): use bytes.as_slice().from_base64() when we upgrade to a Rust version
|
||||
// that includes https://github.com/rust-lang/rust/pull/15810
|
||||
let fake_utf8 = unsafe { str::raw::from_utf8(bytes.as_slice()) };
|
||||
match fake_utf8.from_base64() {
|
||||
match bytes.as_slice().from_base64() {
|
||||
Err(..) => {
|
||||
progress_chan.send(Done(Err("non-base64 data uri".to_string())));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue