31
things rust shipped without (2015)
(graydon2.dreamwidth.org)
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Credits
But the impl markes that it is a trait to the programmers.
Take the following functions:
Does the following snippet compile?
Under the current rules we know it will. But if A could be a trait, the functions could return different types. We currently mark that with the
impl
.What value does cluttering up your code with
-> ()
provide?Because the unit type is special, just like the never
!
type.()
also has the special importance of being the return value of an empty statement and some other stuff.It's fixed with semicolons ;-)