Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you define a function that does some preprocessing before creating an instance in Rust, it is not a special member function that the language understands. It’s just a regular old function that happens to return an instance.

I do agree that it can be useful when discussing code to refer to these style functions with a more specific term, like a constructor, but that’s a colloquialism, and when discussing language features, being precise is important.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: