1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use super::*;
pub struct PrintOptions {
pub max_width: u32,
pub indent_width: u8,
pub use_tabs: bool,
pub newline_kind: &'static str,
pub is_testing: bool,
}
pub fn print<TString, TInfo, TCondition>(
print_items: Vec<PrintItem<TString, TInfo, TCondition>>,
options: PrintOptions
) -> String where TString : StringRef, TInfo : InfoRef, TCondition : ConditionRef<TString, TInfo, TCondition> {
let write_items = get_write_items(print_items, GetWriteItemsOptions {
indent_width: options.indent_width,
max_width: options.max_width,
is_testing: options.is_testing,
});
print_write_items(write_items, PrintWriteItemsOptions {
use_tabs: options.use_tabs,
newline_kind: options.newline_kind,
indent_width: options.indent_width,
})
}