From: Nick Cameron Date: Fri, 1 Sep 2017 04:15:25 +0000 (+1200) Subject: Windows line endings X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=fbb1612846dbd836bef45221793c0ce698bf6cde;hp=abc0530279b45030555a9374a12c0718d82a28fe;p=rust.git Windows line endings --- diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index b94ab9db298..cc84e340c74 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -608,7 +608,7 @@ pub fn run(mut krate: clean::Crate, // A short, single-line view of `s`. fn concise_str(s: &str) -> String { if s.contains('\n') { - return format!("{}...", &s[..s.find('\n').unwrap()]); + return format!("{}...", s.lines().next().expect("Impossible! We just found a newline")); } if s.len() > 70 { return format!("{} ... {}", &s[..50], &s[s.len()-20..]);