genco::lang::dart

Function doc_comment

Source
pub fn doc_comment<T>(comment: T) -> DocComment<T>
where T: IntoIterator, T::Item: Into<ItemStr>,
Expand description

Format a doc comment where each line is preceeded by ///.

ยงExamples

use genco::prelude::*;
use std::iter;

let toks = quote! {
    $(dart::doc_comment(vec!["Foo"]))
    $(dart::doc_comment(iter::empty::<&str>()))
    $(dart::doc_comment(vec!["Bar"]))
};

assert_eq!(
    vec![
        "/// Foo",
        "/// Bar",
    ],
    toks.to_file_vec()?
);