Quantcast
Viewing all articles
Browse latest Browse all 40

struct with parentheses vs double parentheses in Rust

What is the difference between?

struct Test();struct Test(());

I understand that a struct can have tuples (unnamed fields). However, I am not sure what does (()) mean in such a case? That it's a struct with one element which is an empty tuple?


Viewing all articles
Browse latest Browse all 40

Trending Articles