@hatchet
#RustProTip №36: Specify the type of `self` in method signatures
While the three most common types of the `self` parameter have useful shorthands (`self`, `&self`, `&mut self`), the explicit syntax can also include standard library types that deref to `Self`, including `Box<T>`, `Rc<T>`, `Arc<T>`.
Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3c62ee66a4590666ca3aa85070829687
Docs: https://doc.rust-lang.org/reference/items/associated-items.html#methods
All Rust Pro Tips: https://geeklaunch.io/blog/rust-pro-tips-collection/
#rust #rustlang #programming