pub fn to_doc(&self) -> Doc<'_, BoxDoc<'_, ()>> {
        let docs = Doc::concat(
            self.docs
                .iter()
                .map(|doc| doc.to_doc().append(Doc::newline())),
        );
        let params = Doc::intersperse(self.params.iter().map(IntroParam::to_doc), Doc::space());
        let body_ty = self.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(docs)
            .append(self.label.to_doc())
            .append(Doc::space())
            .append(params)
            .append(Doc::space())
            .append(body_ty)
            .append("=")
            .append(Doc::space())
            .append(self.body.to_doc())
            .append(";")
    }
/// Convert the definition into a pretty-printable document
Convert the definition into a pretty-printable document
Convert the definition into a pretty - printable document
pub fn to_doc(&self) -> Doc<'_, BoxDoc<'_, ()>> {
        let docs = Doc::concat(
            self.docs
                .iter()
                .map(|doc| doc.to_doc().append(Doc::newline())),
        );
        let params = Doc::intersperse(self.params.iter().map(IntroParam::to_doc), Doc::space());
        let body_ty = self.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(docs)
            .append(self.label.to_doc())
            .append(Doc::space())
            .append(params)
            .append(Doc::space())
            .append(body_ty)
            .append("=")
            .append(Doc::space())
            .append(self.body.to_doc())
            .append(";")
    }
pub fn to_doc ( & self ) -> Doc < ' _ , BoxDoc < ' _ , ( ) > > { let docs = Doc :: concat ( self . docs . iter ( ) . map ( | doc | doc . to_doc ( ) . append ( Doc :: newline ( ) ) ) , ) ; let params = Doc :: intersperse ( self . params . iter ( ) . map ( IntroParam :: to_doc ) , Doc :: space ( ) ) ; let body_ty = self . 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 ( docs ) . append ( self . label . to_doc ( ) ) . append ( Doc :: space ( ) ) . append ( params ) . append ( Doc :: space ( ) ) . append ( body_ty ) . append ( " " ) . append ( Doc :: space ( ) ) . append ( self . body . to_doc ( ) ) . append ( " " ) }
Convert the definition into a pretty-printable document
Convert the definition into a pretty - printable document
&self