Hacker News new | ask | show | jobs
by speed_spread 1178 days ago
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.
2 comments

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]`.