fn generate_multiline_comments(comment: &str) -> TokenStream {
    let lines = comment.lines().map(|line| {
        let with_leading_space = format!(" {}", line);
        quote! {
            #[doc = #with_leading_space]
        }
    });

    quote! {
        #(#lines)*
    }
}
/// When generating a comment with `#[doc]` if the string is multi-lined then `quote_spanned` seems
/// to get confused and puts the rest of the lines of the string in a separate token tree.
/// This method simply takes a multi-line string literal, breaks it up into separate lines, and
/// generates one `#[doc...]` comment per line
When generating a comment with `#[doc]` if the string is multi-lined then `quote_spanned` seems
to get confused and puts the rest of the lines of the string in a separate token tree.
This method simply takes a multi-line string literal, breaks it up into separate lines, and
generates one `#[doc...]` comment per line
When generating a comment with ` # [ doc ] ` if the string is multi - lined then ` quote_spanned ` seems to get confused and puts the rest of the lines of the string in a separate token tree . This method simply takes a multi - line string literal breaks it up into separate lines and generates one ` # [ doc ... ] ` comment per line
fn generate_multiline_comments(comment: &str) -> TokenStream {
    let lines = comment.lines().map(|line| {
        let with_leading_space = format!(" {}", line);
        quote! {
            #[doc = #with_leading_space]
        }
    });
    quote! {
        #(#lines)*
    }
}
fn generate_multiline_comments ( comment : & str ) -> TokenStream { let lines = comment . lines ( ) . map ( | line | { let with_leading_space = format ! ( " " line ) ; quote ! { [ doc with_leading_space ] } } ) ; quote ! { ( lines ) } }
When generating a comment with `#[doc]` if the string is multi-lined then `quote_spanned` seems
to get confused and puts the rest of the lines of the string in a separate token tree.
When generating a comment with ` # [ doc ] ` if the string is multi - lined then ` quote_spanned ` seems to get confused and puts the rest of the lines of the string in a separate token tree .
comment
&str
comment
&str