-
-
Notifications
You must be signed in to change notification settings - Fork 19
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 Future.discard extension method #60
Conversation
@lenguyenthanh ^ for adding unused checks to lila |
scalalib already provides |
Ah, I didn't notice this. But I'm not sure this @lenguyenthanh would be able to comment more. I saw it mentioned in zulip but I can't find the thread anymore. |
extension [A](a: A) def discard: Unit = () would allow discarding any value and returning unit by adding |
this is the thread that @isaacl mentioned: https://hq.lichess.ovh/#narrow/stream/8-dev/topic/scala.20detection.20of.20dangling.20code I think |
@lenguyenthanh Would |
It's quite ubiquitous in our code base, my gut feelings is about few hundreds. tbh, I'm not sure 🤷 . Maybe it's worth trying. If We try, we can just add this extension function to lila and apply zero waste plugin and see how it go. Example in lila-search: https://github.com/ghik/zerowaste (which is 100% pure I don't have to do any massaging) |
OK, I'll adjust this PR to add |
This method can be used to mark Future values that we're explicitly ignoring, to enable better unused value detection.
46c917d
to
2c34d60
Compare
This method can be used to mark Future values that we're explicitly ignoring, to enable better unused value detection.