Skip to content

Commit 208f3a1

Browse files
style: use short Error path in find_project_root, restore comment
1 parent 2e0e727 commit 208f3a1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,18 @@ pub fn find_workspace_root(project_dir: &Path) -> Option<PathBuf> {
167167
///
168168
/// Returns the canonicalized directory containing the nearest Cargo.toml.
169169
/// Starts checking `start_dir` itself, then walks up through parents.
170-
pub fn find_project_root(start_dir: &Path) -> Result<PathBuf, crate::error::Error> {
170+
pub fn find_project_root(start_dir: &Path) -> Result<PathBuf, Error> {
171171
let start = start_dir
172172
.canonicalize()
173-
.map_err(|_| crate::error::Error::NoProjectFound(start_dir.to_path_buf()))?;
173+
.map_err(|_| Error::NoProjectFound(start_dir.to_path_buf()))?;
174174
let mut dir = start.as_path();
175175
loop {
176176
if dir.join("Cargo.toml").exists() {
177177
return Ok(dir.to_path_buf());
178178
}
179179
match dir.parent() {
180180
Some(parent) => dir = parent,
181-
None => return Err(crate::error::Error::NoProjectFound(start_dir.to_path_buf())),
181+
None => return Err(Error::NoProjectFound(start_dir.to_path_buf())),
182182
}
183183
}
184184
}

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ fn default_tags_dir() -> Result<PathBuf, Error> {
631631
if local.is_dir() {
632632
return Ok(local);
633633
}
634+
// Auto-create tags dir if runs exist (tags live alongside runs)
634635
let runs_local = project.join("target/piano/runs");
635636
if runs_local.is_dir() {
636637
std::fs::create_dir_all(&local)?;

0 commit comments

Comments
 (0)