Re:Code Health: Make Interfaces Hard to Misuse (2018)
by jrimbault on Sunday September 06, 2020 @06:47AM
(#24390445)
With explicit enforced lifetimes it's harder to misuse. The first method returns the tuple of (Something, Token) and the second method consumes/takes ownership of the Token plus whatever its arguments. This way each call to function2 has to be preceded by a call to function1 and it's checked by the compiler.
[ Parent
| on HN ]
There are no comments on this comment yet.