mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
remove unused code
This commit is contained in:
parent
823d4678a8
commit
78735b6159
1 changed files with 0 additions and 28 deletions
|
@ -3641,34 +3641,6 @@ fn run_solve<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the project root (relative to closest Cargo.lock file)
|
|
||||||
/// ```rust
|
|
||||||
/// match project_root::get_project_root() {
|
|
||||||
/// Ok(p) => println!("Current project root is {:?}", p),
|
|
||||||
/// Err(e) => println!("Error obtaining project root {:?}", e)
|
|
||||||
/// };
|
|
||||||
/// ```
|
|
||||||
pub fn get_project_root() -> io::Result<PathBuf> {
|
|
||||||
use std::fs::read_dir;
|
|
||||||
use std::io::ErrorKind;
|
|
||||||
|
|
||||||
let path = env::current_dir()?;
|
|
||||||
let path_ancestors = path.as_path().ancestors();
|
|
||||||
|
|
||||||
for p in path_ancestors {
|
|
||||||
let has_cargo = read_dir(p)?
|
|
||||||
.into_iter()
|
|
||||||
.any(|p| p.unwrap().file_name() == *"Cargo.lock");
|
|
||||||
if has_cargo {
|
|
||||||
return Ok(PathBuf::from(p));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(io::Error::new(
|
|
||||||
ErrorKind::NotFound,
|
|
||||||
"Ran out of places to find Cargo.toml",
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn unspace<'a, T: Copy>(arena: &'a Bump, items: &[Loc<Spaced<'a, T>>]) -> &'a [Loc<T>] {
|
fn unspace<'a, T: Copy>(arena: &'a Bump, items: &[Loc<Spaced<'a, T>>]) -> &'a [Loc<T>] {
|
||||||
bumpalo::collections::Vec::from_iter_in(
|
bumpalo::collections::Vec::from_iter_in(
|
||||||
items
|
items
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue