We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent abc0530 commit fbb1612Copy full SHA for fbb1612
src/librustdoc/html/render.rs
@@ -608,7 +608,7 @@ pub fn run(mut krate: clean::Crate,
608
// A short, single-line view of `s`.
609
fn concise_str(s: &str) -> String {
610
if s.contains('\n') {
611
- return format!("{}...", &s[..s.find('\n').unwrap()]);
+ return format!("{}...", s.lines().next().expect("Impossible! We just found a newline"));
612
}
613
if s.len() > 70 {
614
return format!("{} ... {}", &s[..50], &s[s.len()-20..]);
0 commit comments