Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl Clone and PartialEq for File and Blog #184

Merged
merged 1 commit into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/file/src/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl BlobContents for Blob {
///
/// `Blob`s can be created directly from `&str`, `&[u8]`, and `js_sys::ArrayBuffer`s using the
/// `Blob::new` or `Blob::new_with_options` functions.
#[derive(Debug)]
#[derive(Debug, Clone, PartialEq)]
pub struct Blob {
inner: web_sys::Blob,
}
Expand Down Expand Up @@ -163,7 +163,7 @@ impl AsRef<JsValue> for Blob {
}

/// A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
#[derive(Debug)]
#[derive(Debug, Clone, PartialEq)]
pub struct File {
// the trick here is that we know the contents of `inner` are a file, even though that type
// information is not stored. It is the same trick as is used in `web_sys`.
Expand Down
1 change: 1 addition & 0 deletions crates/file/src/file_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::blob::File;
use wasm_bindgen::prelude::*;

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