diff options
| author | Eric Arellano <ericarellano@me.com> | 2020-12-07 14:00:31 -0700 |
|---|---|---|
| committer | Eric Arellano <ericarellano@me.com> | 2020-12-07 14:00:31 -0700 |
| commit | 85e9ea015220cc74dc54873974ed7138ea22eced (patch) | |
| tree | 6571e67775e004f6ea3ed931bbb2408f5a72d5c4 /src/librustdoc/html/render | |
| parent | 7bd47bd7a14a32be27382677a98d7a031785fc6e (diff) | |
| download | rust-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.rs | 6 |
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) } } |
