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

Implement IFormattable on Option<T> #21

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

atifaziz
Copy link
Contributor

This PR builds on top of #19 and addresses #20 to fully address the examples called out in #17.

The IFormattable implementation is explicit.

This renders Option<T>.ToString() consistent with Nullable<T>.ToString() and easier to substitute for.
Instead of hopping over another String.Format (and causing an
allocation of another format string), delegate to the underlying
implementation of IFormattable on the value if it exists, otherwise to
Option's own ToString().
@Clindbergh
Copy link

@nlkl Is there a reason this is not merged? Thank you.

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.

2 participants