4 ms·
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.
by Aisen8010 4y 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.
- michaelsbradley 4y agoThe empty `discard` statement is a do nothing statement; it's not part of the type signature, if that's what you meant.
- speed_spread 4y agoIgnoring 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.
- girvo 4y agoYou don’t need two functions, you just mark one as {.discardable.} and the discard happens automatically. Unless I’m misunderstanding you.
- michaelsbradley 4y ago`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]`.