Skip to content

Commit

Permalink
[x] make project_root return a &'static Path
Browse files Browse the repository at this point in the history
The conversion to `PathBuf` is unnecessary.

Closes: diem#3269
Approved by: bmwill
  • Loading branch information
sunshowers authored and bors-libra committed Apr 3, 2020
1 parent 3c4503f commit 0e9069e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions x/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ use crate::{cargo::Cargo, Result};
use serde::Deserialize;
use std::path::{Path, PathBuf};

pub fn project_root() -> PathBuf {
pub fn project_root() -> &'static Path {
Path::new(&env!("CARGO_MANIFEST_DIR"))
.ancestors()
.nth(1)
.unwrap()
.to_path_buf()
}

pub fn locate_project() -> Result<PathBuf> {
Expand Down

0 comments on commit 0e9069e

Please sign in to comment.