a_append

Function a_append 

Source
pub fn a_append<C: Cost>(x: Doc<C>, y: Doc<C>) -> Doc<C>
Expand description

Concatenates two documents horizontally with alignment.

If y contains newlines, those lines will stay aligned with the start of y, rather than flowing back to the current indentation level.

To combine more than two documents or an iterator of documents, use a_concat.

Equivalent to x & align(y).

ยงExample

let doc = a_append(nl() & text("hello "),
                   text("my") & nl() & text("friend"));
assert_eq!(doc.to_string(), r"
hello my
      friend");