Skip to content

Commit

Permalink
Add derive debug, clone for FormData and File
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-ardi committed Sep 30, 2023
1 parent 289132d commit 32825eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker/src/formdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ use wasm_bindgen::JsCast;
use wasm_bindgen_futures::JsFuture;

/// Representing the options any FormData value can be, a field or a file.
#[derive(Debug, Clone)]
pub enum FormEntry {
Field(String),
File(File),
}

/// A [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData) representation of the
/// request body, providing access to form encoded fields and files.
#[derive(Debug)]
pub struct FormData(web_sys::FormData);

impl FormData {
pub fn new() -> Self {
Self(web_sys::FormData::new().unwrap())
Expand Down Expand Up @@ -112,6 +111,7 @@ impl From<HashMap<&dyn AsRef<&str>, &dyn AsRef<&str>>> for FormData {

/// A [File](https://developer.mozilla.org/en-US/docs/Web/API/File) representation used with
/// `FormData`.
#[derive(Debug, Clone)]
pub struct File(web_sys::File);

impl File {
Expand Down

0 comments on commit 32825eb

Please sign in to comment.