On inheritance and why it's good Rust doesn't have it

thecodedmessage.com/posts/oop-…

Discussions: discu.eu/q/thecodedmessage.com…

#programming #rustlang

in reply to Rust Weekly 🦀

Just noticed this in the article that I think is not accurate:

"There is no inheritance in Rust. There are no fields in traits. There is simply no way of saying that in order to implement a trait, your type must have certain fields."

Traits can have implemented methods taking self, and if those methods refer to fields in self type-checking won't allow a struct to implement that trait without having those fields, no?

⇧