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

feat: adds Default implementation for PromiseOrValue #1008

Closed
wants to merge 2 commits into from

Conversation

encody
Copy link
Contributor

@encody encody commented Feb 20, 2023

  • Only implements for PromiseOrValue<T> where T: Default.
  • Returns the Value(..) variant.

	- only implements for PromiseOrValue<T> where T: Default
@frol
Copy link
Collaborator

frol commented Jun 20, 2023

I am a bit concerned about the semantics of PromiseOrValue::default(). I will need to think about it more. Adding it is not a breaking change, but removing would be a breaking change, so I would prefer to be on the safer side of things.

@agostbiro
Copy link
Contributor

Thanks for submitting this PR @encody ! I'm inclined to agree with @frol : adding a default implementation for sum types can lead to surprising results, and changes are to be expected to Promise in #936, so I'm leaning towards respectfully declining this for now.

@frol frol closed this Aug 17, 2023
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