ITADN

Feature: Support `skip` on `Clone` derives

#104Closedoverdrivenpotato 创建于 2025-01-21
Sometimes, it's useful to derive `Clone` for types with fields that cannot be cloned, and need to be re-initialized: ```rust #[derive_where(Clone, Debug)] struct Foo { // Defaults to `Option::<TcpStream>::default()` on clone #[derive_where(skip(Clone))] connection: Option<TcpStream>, s: String, #[derive_where(skip(Debug))] i: i32, } ``` Alternatively maybe `#[derive_where(default(Clone))]` makes more sense here.
关闭于 2025-04-29 3 条评论