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

Add derive debug, clone for FormData and File #395

Closed
wants to merge 3 commits into from

Conversation

dev-ardi
Copy link
Contributor

This adds derive macros for a couple of types. There's no reason not to have them.

@dev-ardi dev-ardi force-pushed the derive-debug-clone branch 3 times, most recently from 32825eb to 7494fe3 Compare September 30, 2023 22:42
@dev-ardi
Copy link
Contributor Author

I've added a few more

@@ -182,10 +183,3 @@ impl From<Headers> for HeaderMap {
(&headers).into()
}
}

impl Clone for Headers {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use the derive-based clone implementation here as we do an explicit call to web_sys::Headers::new_with_headers because the inner JS headers are sometimes immutable. The derive clone will just clone a reference to those potentially immutable headers where-as the explicit clone will perform a deep copy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't use workers anymore, feel free to close this PR

@kflansburg kflansburg closed this Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants