pub macro impl_default_fold($Src: ty, $Dst: ty) {
...
}Expand description
ⓘ
pub macro impl_default_fold($Src: ty, $Dst: ty)Implements Into-based defaults for the required Fold members:
Fold::fold_annotationwhere Src::Annotation: Into<Dst::Annotation>Fold::fold_macro_idwhere Src::MacroId: Into<Dst::MacroId>Fold::fold_symbolwhere Src::Symbol: Into<Dst::Symbol>Fold::fold_pathwhere Src::Path: Into<Dst::Path>Fold::fold_literalwhere Src::Literal: Into<Dst::Literal>
§Examples:
Implements an “identity” folder
struct IdentityFold;
impl<A: AstTypes> Fold<A, A> for IdentityFold {
type Error = std::convert::Infallible;
impl_default_fold!(A, A);
}