about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorEric Arellano <ericarellano@me.com>2020-12-07 14:00:31 -0700
committerEric Arellano <ericarellano@me.com>2020-12-07 14:00:31 -0700
commit85e9ea015220cc74dc54873974ed7138ea22eced (patch)
tree6571e67775e004f6ea3ed931bbb2408f5a72d5c4 /src/librustdoc/html/render
parent7bd47bd7a14a32be27382677a98d7a031785fc6e (diff)
downloadrust-85e9ea015220cc74dc54873974ed7138ea22eced.tar.gz
rust-85e9ea015220cc74dc54873974ed7138ea22eced.zip
Dogfood 'str_split_once() with librustdoc
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/mod.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 901f00b21da..efee4c0be06 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -167,10 +167,8 @@ impl Context {
         // `style-suffix.min.css`.  Path::extension would just return `css`
         // which would result in `style.min-suffix.css` which isn't what we
         // want.
-        let mut iter = filename.splitn(2, '.');
-        let base = iter.next().unwrap();
-        let ext = iter.next().unwrap();
-        let filename = format!("{}{}.{}", base, self.shared.resource_suffix, ext,);
+        let (base, ext) = filename.split_once('.').unwrap();
+        let filename = format!("{}{}.{}", base, self.shared.resource_suffix, ext);
         self.dst.join(&filename)
     }
 }