T { ..t }
Inside the trait "Self" is an alias for "Number".
"&self" is shorthand for "self: &Number", i.e., a reference to Number.
To dereference a reference, prefix with
*
self
and
*self
Thus,
Self { ..*self }
Disclaimer! everything I know about rust I learned 2 days ago from this blog post, so I might be wrong :-)
Inside the trait "Self" is an alias for "Number".
"&self" is shorthand for "self: &Number", i.e., a reference to Number.
To dereference a reference, prefix with
So: has type "&Number"and
has type "Number".Thus,
is creating a new instance of Number with its each set to the same value as self.Disclaimer! everything I know about rust I learned 2 days ago from this blog post, so I might be wrong :-)