From 0b3bc9b5e29ba867172120361fb32716fdb99e30 Mon Sep 17 00:00:00 2001 From: mitaa Date: Fri, 26 Feb 2016 17:39:37 +0100 Subject: [PATCH] Correct plain-summary-line For plaintext we don't actually need to render the Markdown before shortening the string. (and this may have led to wrong output) --- src/librustdoc/html/render.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index d7100f9f220..af6dec8dc86 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1657,8 +1657,8 @@ fn shorter<'a>(s: Option<&'a str>) -> String { #[inline] fn plain_summary_line(s: Option<&str>) -> String { - let md = markdown::plain_summary_line(s.unwrap_or("")); - shorter(Some(&md)).replace("\n", " ") + let line = shorter(s).replace("\n", " "); + markdown::plain_summary_line(&line[..]) } fn document(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item) -> fmt::Result {