pub fn merge(
    name: &SpannedString<'_>,
    decl_docs: &[SpannedString<'_>],
    defn_docs: &[SpannedString<'_>],
) -> Result<DocString, Diagnostic<FileSpan>> {
    match (decl_docs, defn_docs) {
        ([], []) => Ok("".into()),
        (docs, []) => Ok(concat(docs)),
        ([], docs) => Ok(concat(docs)),
        (_, _) => Err(
            Diagnostic::new_error(format!("`{}` is already documented!", name))
                .with_label(
                    DiagnosticLabel::new_primary(doc_span(decl_docs).unwrap())
                        .with_message("the definition's documentation"),
                )
                .with_label(
                    DiagnosticLabel::new_secondary(doc_span(decl_docs).unwrap())
                        .with_message("the declaration's documentation"),
                ),
        ),
    }
}
/// Select the documentation from either the declaration or the definition,
/// returning an error if both are present.
Select the documentation from either the declaration or the definition,
returning an error if both are present.
Select the documentation from either the declaration or the definition returning an error if both are present .
pub fn merge(
    name: &SpannedString<'_>,
    decl_docs: &[SpannedString<'_>],
    defn_docs: &[SpannedString<'_>],
) -> Result<DocString, Diagnostic<FileSpan>> {
    match (decl_docs, defn_docs) {
        ([], []) => Ok("".into()),
        (docs, []) => Ok(concat(docs)),
        ([], docs) => Ok(concat(docs)),
        (_, _) => Err(
            Diagnostic::new_error(format!("`{}` is already documented!", name))
                .with_label(
                    DiagnosticLabel::new_primary(doc_span(decl_docs).unwrap())
                        .with_message("the definition's documentation"),
                )
                .with_label(
                    DiagnosticLabel::new_secondary(doc_span(decl_docs).unwrap())
                        .with_message("the declaration's documentation"),
                ),
        ),
    }
}
pub fn merge ( name : & SpannedString < ' _ > , decl_docs : & [ SpannedString < ' _ > ] , defn_docs : & [ SpannedString < ' _ > ] , ) -> Result < DocString , Diagnostic < FileSpan > > { match ( decl_docs , defn_docs ) { ( [ ] , [ ] ) => Ok ( " " . into ( ) ) , ( docs , [ ] ) => Ok ( concat ( docs ) ) , ( [ ] , docs ) => Ok ( concat ( docs ) ) , ( _ , _ ) => Err ( Diagnostic :: new_error ( format ! ( " " name ) ) . with_label ( DiagnosticLabel :: new_primary ( doc_span ( decl_docs ) . unwrap ( ) ) . with_message ( " " ) , ) . with_label ( DiagnosticLabel :: new_secondary ( doc_span ( decl_docs ) . unwrap ( ) ) . with_message ( " " ) , ) , ) , } }
Select the documentation from either the declaration or the definition,
returning an error if both are present.
Select the documentation from either the declaration or the definition returning an error if both are present .
name
&SpannedString<'_>
decl_docs
&[SpannedString<'_>]
defn_docs
&[SpannedString<'_>]