Use empty Vec instead of None.

This commit is contained in:
Michael Howell 2015-07-26 13:49:29 -07:00
parent 5a66b59f9b
commit 572616605a
2 changed files with 14 additions and 23 deletions

View file

@ -82,14 +82,14 @@ impl Blob {
}
pub trait BlobHelpers {
fn read_out_buffer(self) -> Receiver<Option<Vec<u8>>> ;
fn read_out_buffer(self) -> Receiver<Vec<u8>>;
fn read_out_type(self) -> DOMString;
}
impl<'a> BlobHelpers for &'a Blob {
fn read_out_buffer(self) -> Receiver<Option<Vec<u8>>> {
fn read_out_buffer(self) -> Receiver<Vec<u8>> {
let (send, recv) = mpsc::channel();
send.send(self.bytes.clone()).unwrap();
send.send(self.bytes.clone().unwrap_or(vec![])).unwrap();
recv
}
fn read_out_type(self) -> DOMString {