diff --git a/proxmox-schema/Cargo.toml b/proxmox-schema/Cargo.toml index b8ff6a6d..ea03237e 100644 --- a/proxmox-schema/Cargo.toml +++ b/proxmox-schema/Cargo.toml @@ -14,7 +14,7 @@ lazy_static = "1.4" regex = "1.5" serde = "1.0" serde_json = "1.0" -textwrap = "0.11" +textwrap = "0.15" # the upid type needs this for 'getpid' libc = { version = "0.2", optional = true } diff --git a/proxmox-schema/src/format.rs b/proxmox-schema/src/format.rs index 08012146..4e497ba5 100644 --- a/proxmox-schema/src/format.rs +++ b/proxmox-schema/src/format.rs @@ -37,11 +37,11 @@ pub fn wrap_text( text: &str, columns: usize, ) -> String { - let wrapper1 = textwrap::Wrapper::new(columns) + let wrap_options1 = textwrap::Options::new(columns) .initial_indent(initial_indent) .subsequent_indent(subsequent_indent); - let wrapper2 = textwrap::Wrapper::new(columns) + let wrap_options2 = textwrap::Options::new(columns) .initial_indent(subsequent_indent) .subsequent_indent(subsequent_indent); @@ -50,9 +50,9 @@ pub fn wrap_text( .filter(|p| !p.is_empty()) .fold(String::new(), |mut acc, p| { if acc.is_empty() { - acc.push_str(&wrapper1.wrap(p).join("\n")); + acc.push_str(&textwrap::wrap(p, &wrap_options1).join("\n")); } else { - acc.push_str(&wrapper2.wrap(p).join("\n")); + acc.push_str(&textwrap::wrap(p, &wrap_options2).join("\n")); } acc.push_str("\n\n"); acc