debug-ignore
debug-ignore copied to clipboard
Add From to easier create the wrapped object
Currently:
#[derive(Debug)]
pub struct PublicStruct {
inner: DebugIgnore<InnerStructWithLotsOfDebugInfo>,
}
impl PublicStruct {
pub fn new() -> Self {
Self {
inner: DebugIgnore(InnerStructWithLotsOfDebugInfo { field: "field", /* ... */ })
}
}
}
If From is implemented, it will allow to call .into(), similar to what Option has:
impl PublicStruct {
pub fn new() -> Self {
Self {
- inner: DebugIgnore(InnerStructWithLotsOfDebugInfo { field: "field", /* ... */ })
+ inner: InnerStructWithLotsOfDebugInfo { field: "field", /* ... */ }.into()
}
}
}
Sounds good! Would you like to submit a patch? Should be pretty simple.