Skip to content

Commit 63284c6

Browse files
committed
Use PathBuf instead of Path to avoid borrow error
1 parent cc09d3d commit 63284c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/create-disk-image.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ members = ["kernel"]
3838
```rust
3939
// build.rs
4040

41-
use std::path::Path;
41+
use std::path::PathBuf;
4242

4343
fn main() {
4444
// set by cargo, build scripts should use this directory for output files
45-
let out_dir = Path::new(&std::env::var_os("OUT_DIR").unwrap());
45+
let out_dir = PathBuf::from(std::env::var_os("OUT_DIR").unwrap());
4646
// set by cargo's artifact dependency feature, see
4747
// https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#artifact-dependencies
48-
let kernel = Path::new(&std::env::var_os("CARGO_BIN_FILE_KERNEL_kernel").unwrap());
48+
let kernel = PathBuf::from(std::env::var_os("CARGO_BIN_FILE_KERNEL_kernel").unwrap());
4949

5050
// create an UEFI disk image (optional)
5151
let uefi_path = out_dir.join("uefi.img");

0 commit comments

Comments
 (0)