summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2015-01-02 13:56:28 +1300
committerNick Cameron <ncameron@mozilla.com>2015-01-07 10:46:33 +1300
commitf7ff37e4c52a1d6562635fcd5bab6309cf75ea08 (patch)
tree9c69736bf3830f9048f61d45943bf0fa6326782d /src/librustdoc/html
parent918255ef8c3c21b2009204c3019239f8dc9f46bf (diff)
downloadrust-f7ff37e4c52a1d6562635fcd5bab6309cf75ea08.tar.gz
rust-f7ff37e4c52a1d6562635fcd5bab6309cf75ea08.zip
Replace full slice notation with index calls
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/format.rs4
-rw-r--r--src/librustdoc/html/highlight.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 9004d11b5bc..6c0f6610802 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -311,7 +311,7 @@ fn path<F, G>(w: &mut fmt::Formatter,
         match rel_root {
             Some(root) => {
                 let mut root = String::from_str(root.as_slice());
-                for seg in path.segments[..amt].iter() {
+                for seg in path.segments.index(&(0..amt)).iter() {
                     if "super" == seg.name ||
                             "self" == seg.name {
                         try!(write!(w, "{}::", seg.name));
@@ -326,7 +326,7 @@ fn path<F, G>(w: &mut fmt::Formatter,
                 }
             }
             None => {
-                for seg in path.segments[..amt].iter() {
+                for seg in path.segments.index(&(0..amt)).iter() {
                     try!(write!(w, "{}::", seg.name));
                 }
             }
diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs
index 30b9d6c63c5..3d2c5e2cbb5 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.index(&FullRange)).into_owned()
 }
 
 /// Exhausts the `lexer` writing the output into `out`.