pub fn to_doc(&self) -> Doc<'_, BoxDoc<'_, ()>> {
        match self {
            RecordIntroField::Punned { label } => label.to_doc().append(";"),
            RecordIntroField::Explicit {
                label,
                params,
                body_ty,
                body,
            } => {
                let params = Doc::intersperse(params.iter().map(IntroParam::to_doc), Doc::space());
                let body_ty = body_ty.as_ref().map_or(Doc::nil(), |body_ty| {
                    Doc::nil()
                        .append(":")
                        .append(Doc::space())
                        .append(body_ty.to_doc())
                        .append(Doc::space())
                });

                Doc::nil()
                    .append(label.to_doc())
                    .append(Doc::space())
                    .append(params)
                    .append(Doc::space())
                    .append(body_ty)
                    .append("=")
                    .append(Doc::space())
                    .append(body.to_doc())
                    .append(";")
            },
        }
    }
/// Convert the field into a pretty-printable document
Convert the field into a pretty-printable document
Convert the field into a pretty - printable document
pub fn to_doc(&self) -> Doc<'_, BoxDoc<'_, ()>> {
        match self {
            RecordIntroField::Punned { label } => label.to_doc().append(";"),
            RecordIntroField::Explicit {
                label,
                params,
                body_ty,
                body,
            } => {
                let params = Doc::intersperse(params.iter().map(IntroParam::to_doc), Doc::space());
                let body_ty = body_ty.as_ref().map_or(Doc::nil(), |body_ty| {
                    Doc::nil()
                        .append(":")
                        .append(Doc::space())
                        .append(body_ty.to_doc())
                        .append(Doc::space())
                });
                Doc::nil()
                    .append(label.to_doc())
                    .append(Doc::space())
                    .append(params)
                    .append(Doc::space())
                    .append(body_ty)
                    .append("=")
                    .append(Doc::space())
                    .append(body.to_doc())
                    .append(";")
            },
        }
    }
pub fn to_doc ( & self ) -> Doc < ' _ , BoxDoc < ' _ , ( ) > > { match self { RecordIntroField :: Punned { label } => label . to_doc ( ) . append ( " " ) , RecordIntroField :: Explicit { label , params , body_ty , body , } => { let params = Doc :: intersperse ( params . iter ( ) . map ( IntroParam :: to_doc ) , Doc :: space ( ) ) ; let body_ty = body_ty . as_ref ( ) . map_or ( Doc :: nil ( ) , | body_ty | { Doc :: nil ( ) . append ( " " ) . append ( Doc :: space ( ) ) . append ( body_ty . to_doc ( ) ) . append ( Doc :: space ( ) ) } ) ; Doc :: nil ( ) . append ( label . to_doc ( ) ) . append ( Doc :: space ( ) ) . append ( params ) . append ( Doc :: space ( ) ) . append ( body_ty ) . append ( " " ) . append ( Doc :: space ( ) ) . append ( body . to_doc ( ) ) . append ( " " ) } , } }
Convert the field into a pretty-printable document
Convert the field into a pretty - printable document
&self