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

Support for ? operator (Try trait) #861

Closed
wcarmon opened this issue Nov 2, 2022 · 3 comments
Closed

Support for ? operator (Try trait) #861

wcarmon opened this issue Nov 2, 2022 · 3 comments

Comments

@wcarmon
Copy link

wcarmon commented Nov 2, 2022

Can we have support for the ? operator on LocalResult

I believe this means impl Try for LocalResult

https://doc.rust-lang.org/std/ops/trait.Try.html

@djc
Copy link
Member

djc commented Nov 2, 2022

That's not stable yet, which means it would entail adding at least a Cargo feature to optionally enable this... I think it's pretty messy and there's not enough value in doing so until the trait stabilizes.

@wcarmon
Copy link
Author

wcarmon commented Nov 2, 2022

Reasonable.

@wcarmon wcarmon closed this as completed Nov 2, 2022
@esheppa
Copy link
Collaborator

esheppa commented Nov 3, 2022

@wcarmon - you also probably don't want to use ? with LocalResult as you will generally want to handle all the possibilities or transform it to some other type. In future we will likely change the API to have some convenience methods to get a best effort local timestamp, see: #716

@djc djc reopened this Nov 3, 2022
@djc djc closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2022
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

No branches or pull requests

3 participants