Skip to content

Commit 6e02f60

Browse files
authored
impl Clone and PartialEq (#184)
1 parent 923e033 commit 6e02f60

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

crates/file/src/blob.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl BlobContents for Blob {
6666
///
6767
/// `Blob`s can be created directly from `&str`, `&[u8]`, and `js_sys::ArrayBuffer`s using the
6868
/// `Blob::new` or `Blob::new_with_options` functions.
69-
#[derive(Debug)]
69+
#[derive(Debug, Clone, PartialEq)]
7070
pub struct Blob {
7171
inner: web_sys::Blob,
7272
}
@@ -163,7 +163,7 @@ impl AsRef<JsValue> for Blob {
163163
}
164164

165165
/// A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
166-
#[derive(Debug)]
166+
#[derive(Debug, Clone, PartialEq)]
167167
pub struct File {
168168
// the trick here is that we know the contents of `inner` are a file, even though that type
169169
// information is not stored. It is the same trick as is used in `web_sys`.

crates/file/src/file_list.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::blob::File;
22
use wasm_bindgen::prelude::*;
33

44
/// A list of files, for example from an `<input type="file">`.
5+
#[derive(Debug, Clone, PartialEq)]
56
pub struct FileList {
67
inner: Vec<File>,
78
}

0 commit comments

Comments
 (0)