Skip to content

Commit 7085fec

Browse files
committed
refactor(toolchain): allow absolute paths in Toolchain::doc_path()
1 parent 81f63b1 commit 7085fec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/toolchain.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@ impl<'a> Toolchain<'a> {
409409
}
410410

411411
pub fn doc_path(&self, relative: impl AsRef<Path>) -> anyhow::Result<PathBuf> {
412+
let relative = relative.as_ref();
413+
if relative.is_absolute() {
414+
return Ok(relative.to_owned());
415+
}
416+
412417
let mut doc_dir = self.path.clone();
413418
doc_dir.extend(["share", "doc", "rust", "html"]);
414419
doc_dir.push(relative);

0 commit comments

Comments
 (0)