diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index 150849e6f..9ebaad841 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -109,7 +109,7 @@ fn main() -> io::Result<()> { struct MDWriter<'a, 'b> { w: Box, - command: Command<'a>, + command: Command, name: &'a str, tldr_zip: &'b mut Option>, utils_per_platform: &'b HashMap<&'b str, Vec>, @@ -167,13 +167,16 @@ impl<'a, 'b> MDWriter<'a, 'b> { let mut usage: String = self .command .render_usage() + .to_string() .lines() .skip(1) .map(|l| l.trim()) .filter(|l| !l.is_empty()) .collect::>() .join("\n"); - usage = usage.replace(uucore::execution_phrase(), self.name); + usage = usage + .to_string() + .replace(uucore::execution_phrase(), self.name); writeln!(self.w, "{}", usage)?; writeln!(self.w, "```") } @@ -282,7 +285,10 @@ impl<'a, 'b> MDWriter<'a, 'b> { writeln!( self.w, "
\n\n{}\n\n
", - arg.get_help().unwrap_or_default().replace('\n', "
") + arg.get_help() + .unwrap_or_default() + .to_string() + .replace('\n', "
") )?; } writeln!(self.w, "\n")