Hacker News new | ask | show | jobs
by Aisen8010 1178 days ago
It's good to see that they chose the keyword discard instead of the underscore symbol. It's verbose, but at least you can see the damn thing.
2 comments

The empty `discard` statement is a do nothing statement; it's not part of the type signature, if that's what you meant.
Ignoring a return value is a normal thing in many situations. I like verbose but "discard" is weird enough that it might complexify API design to offer two functions instead of a single one.
You don’t need two functions, you just mark one as {.discardable.} and the discard happens automatically. Unless I’m misunderstanding you.
`discard` isn’t part of the type signature.

The functions in the blog post have void return type because between `)` and `=` there is no `: [type]`.