cli-output: Genericize `writeln_name_value()`
This commit is contained in:
parent
e4da6761a7
commit
2820d0a23d
|
@ -35,7 +35,7 @@ pub fn println_name_value(name: &str, value: &str) {
|
||||||
println!("{} {}", style(name).bold(), styled_value);
|
println!("{} {}", style(name).bold(), styled_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn writeln_name_value(f: &mut fmt::Formatter, name: &str, value: &str) -> fmt::Result {
|
pub fn writeln_name_value(f: &mut dyn fmt::Write, name: &str, value: &str) -> fmt::Result {
|
||||||
let styled_value = if value.is_empty() {
|
let styled_value = if value.is_empty() {
|
||||||
style("(not set)").italic()
|
style("(not set)").italic()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue