From 1c4467841dbc8b2421c6e0031d17135f4aa788bf Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 22 Oct 2024 14:51:04 +0200 Subject: [PATCH] schema: property description: output indentation where its required The wrap_text helper accepts and initial indentation, so use that as central point to add the indentation that glues the list entry together with its description. Mostly a small optimization, should not matter in practice, i.e. where all properties should have a description. Signed-off-by: Thomas Lamprecht --- proxmox-schema/src/format.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proxmox-schema/src/format.rs b/proxmox-schema/src/format.rs index caba82ea..31fcef8a 100644 --- a/proxmox-schema/src/format.rs +++ b/proxmox-schema/src/format.rs @@ -270,22 +270,22 @@ pub fn get_property_description( let mut text = match style { ParameterDisplayStyle::Config => { // reST definition list format - format!("``{name}`` : ``{type_text}{default_text}``\n ") + format!("``{name}`` : ``{type_text}{default_text}``\n") } ParameterDisplayStyle::ConfigSub => { // reST definition list format - format!("``{name}`` = ``{type_text}{default_text}``\n ") + format!("``{name}`` = ``{type_text}{default_text}``\n") } ParameterDisplayStyle::Arg => { // reST option list format - format!("``--{name}`` ``{type_text}{default_text}``\n ") + format!("``--{name}`` ``{type_text}{default_text}``\n") } ParameterDisplayStyle::Fixed => { - format!("``<{name}>`` : ``{type_text}{default_text}``\n ") + format!("``<{name}>`` : ``{type_text}{default_text}``\n") } }; - text.push_str(&wrap_text("", " ", &descr, 80)); + text.push_str(&wrap_text(" ", " ", &descr, 80)); text } else {