Skip to content

Commit

Permalink
rustdoc: get back 'plain summary line' in sidebar
Browse files Browse the repository at this point in the history
this feature was broken by mistake some days ago: @2b11a80
  • Loading branch information
liigo committed Mar 10, 2015
1 parent 12b846a commit 29ff77f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ impl Context {
let short = short.to_string();
let v = map.entry(short).get().unwrap_or_else(
|vacant_entry| vacant_entry.insert(Vec::with_capacity(1)));
v.push((myname, Some(shorter_line(item.doc_value()))));
v.push((myname, Some(plain_summary_line(item.doc_value()))));
}

for (_, items) in &mut map {
Expand Down Expand Up @@ -1478,8 +1478,9 @@ fn shorter<'a>(s: Option<&'a str>) -> &'a str {
}

#[inline]
fn shorter_line(s: Option<&str>) -> String {
shorter(s).replace("\n", " ")
fn plain_summary_line(s: Option<&str>) -> String {
let line = shorter(s).replace("\n", " ");
markdown::plain_summary_line(&line[..])
}

fn document(w: &mut fmt::Formatter, item: &clean::Item) -> fmt::Result {
Expand Down

0 comments on commit 29ff77f

Please sign in to comment.