logoalt Hacker News

binary132today at 1:03 AM2 repliesview on HN

why not just create a wrapper type for the payload that is returned by func1 and func2 takes it as a parameter?


Replies

vatsachaktoday at 2:13 AM

That's fair but then you have to make your args a struct for this bespoke purpose; an anti pattern.

Also, many other functions can depend on the ticket from func_1. So making the ticket separate and generic on the process is the right (imo) solution here.

show 1 reply
llleeeooohtoday at 1:57 AM

Because you may want to share certain behaviors between the two wrapper types via generic impl

show 1 reply