Tuple struct can be used as func param. How does this helps me?

image
I know this is duplicating. Idk the key words I should use to search. What is the key words? Tuple struct can be used as func param. How does this helps me? Or I should skip it and focus on other useful topics? Thanks.

Ask your editor what T has been inferred to be.

struct SS(i32) creates both a type named SS and a constructor function named SS. The function has a signature like this:

fn SS(x: i32) -> SS

You are passing a reference to that function.

4 Likes

Thanks. I will go through more detailful syntax tutorial later.

In the future, please post code as actual text instead of as an image. It lets people copy & paste your code so they can try it out, and it lets users with screen readers know what you're asking about.

5 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.