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

The common scenario for f and g to consume x is that x is a smart pointer type e.g. Rc/Arc.

to make it clear that the clone is "cheap", some Rust developer prefer using `Arc::Clone(&x)` over `x.clone()`.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: