diff options
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/flock.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/highlight.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/markdown.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 3 | ||||
| -rw-r--r-- | src/librustdoc/html/static/main.css | 4 | ||||
| -rw-r--r-- | src/librustdoc/lib.rs | 1 | ||||
| -rw-r--r-- | src/librustdoc/passes.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 2 |
8 files changed, 9 insertions, 11 deletions
diff --git a/src/librustdoc/flock.rs b/src/librustdoc/flock.rs index a7cf5eb8918..ad91c3cb2c3 100644 --- a/src/librustdoc/flock.rs +++ b/src/librustdoc/flock.rs @@ -112,7 +112,7 @@ mod imp { impl Lock { pub fn new(p: &Path) -> Lock { - let buf = CString::from_slice(p.as_vec()); + let buf = CString::new(p.as_vec()).unwrap(); let fd = unsafe { libc::open(buf.as_ptr(), libc::O_RDWR | libc::O_CREAT, libc::S_IRWXU) diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 6acd1537946..44c0acda66f 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -34,7 +34,7 @@ pub fn highlight(src: &str, class: Option<&str>, id: Option<&str>) -> String { class, id, &mut out).unwrap(); - String::from_utf8_lossy(&out[]).into_owned() + String::from_utf8_lossy(&out[..]).into_owned() } /// Exhausts the `lexer` writing the output into `out`. diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index c513fe2e8eb..7ea5bd569e1 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -236,7 +236,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result { s.push_str(&highlight::highlight(&text, None, Some("rust-example-rendered"))); - let output = CString::from_vec(s.into_bytes()); + let output = CString::new(s).unwrap(); hoedown_buffer_puts(ob, output.as_ptr()); }) } @@ -293,7 +293,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result { format!("{} ", sec) }); - let text = CString::from_vec(text.into_bytes()); + let text = CString::new(text).unwrap(); unsafe { hoedown_buffer_puts(ob, text.as_ptr()) } } diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 95994af7dc8..fc3c8738991 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1404,8 +1404,7 @@ impl<'a> fmt::Display for Item<'a> { try!(write!(fmt, r##"<span id='render-detail'> - <a id="collapse-all" href="#">[-] - </a> <a id="expand-all" href="#">[+]</a> + <a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a> </span>"##)); // Write `src` tag diff --git a/src/librustdoc/html/static/main.css b/src/librustdoc/html/static/main.css index a4263badb01..2f0755ecb89 100644 --- a/src/librustdoc/html/static/main.css +++ b/src/librustdoc/html/static/main.css @@ -374,8 +374,8 @@ a { color: #000; background: transparent; } -p a { color: #4e8bca; } -p a:hover { text-decoration: underline; } +.docblock a { color: #4e8bca; } +.docblock a:hover { text-decoration: underline; } .content span.trait, .content a.trait, .block a.current.trait { color: #ed9603; } .content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; } diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index bab734db126..f9e0948d7bc 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -23,7 +23,6 @@ #![feature(collections)] #![feature(core)] #![feature(env)] -#![feature(hash)] #![feature(int_uint)] #![feature(old_io)] #![feature(libc)] diff --git a/src/librustdoc/passes.rs b/src/librustdoc/passes.rs index abd73fcfb70..722f14fa6d4 100644 --- a/src/librustdoc/passes.rs +++ b/src/librustdoc/passes.rs @@ -293,7 +293,7 @@ pub fn collapse_docs(krate: clean::Crate) -> plugins::PluginResult { let mut a: Vec<clean::Attribute> = i.attrs.iter().filter(|&a| match a { &clean::NameValue(ref x, _) if "doc" == *x => false, _ => true - }).map(|x| x.clone()).collect(); + }).cloned().collect(); if docstr.len() > 0 { a.push(clean::NameValue("doc".to_string(), docstr)); } diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index ac1a0285412..c52b0bab1fa 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -333,7 +333,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { name: name, items: items.clone(), generics: gen.clone(), - bounds: b.iter().map(|x| (*x).clone()).collect(), + bounds: b.iter().cloned().collect(), id: item.id, attrs: item.attrs.clone(), whence: item.span, |
