Skip to content

Commit 81f63b1

Browse files
committed
refactor(toolchain): simplify Toolchain::doc_path()
1 parent 3e43e2f commit 81f63b1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/toolchain.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,8 @@ impl<'a> Toolchain<'a> {
409409
}
410410

411411
pub fn doc_path(&self, relative: impl AsRef<Path>) -> anyhow::Result<PathBuf> {
412-
let parts = vec!["share", "doc", "rust", "html"];
413412
let mut doc_dir = self.path.clone();
414-
for part in parts {
415-
doc_dir.push(part);
416-
}
413+
doc_dir.extend(["share", "doc", "rust", "html"]);
417414
doc_dir.push(relative);
418415

419416
Ok(doc_dir)

0 commit comments

Comments
 (0)