a_concat

Function a_concat 

Source
pub fn a_concat<C: Cost>(xs: impl IntoIterator<Item = Doc<C>>) -> Doc<C>
Expand description

Concatenates several documents horizontally with alignment.

Equivalent to calling a_append successively to combine the documents in the iterator. If the iterator is empty, it returns text("").

ยงExample

let doc = a_concat([
    nl() & text("hello "),
    text("my") & nl() & text("friend "),
    text("how are") & nl() & text("you?"),
]);
assert_eq!(doc.to_string(), r"
hello my
      friend how are
             you?");

let doc = a_concat([]);
assert_eq!(doc.to_string(), "");