1
Fork 0

Dogfood 'str_split_once() with librustdoc

This commit is contained in:
Eric Arellano 2020-12-07 14:00:31 -07:00
parent 7bd47bd7a1
commit 85e9ea0152
4 changed files with 12 additions and 17 deletions

View file

@ -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)
}
}