From deb2b70a26bdca0334a783f729e15773ae0b354b Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 9 May 2014 10:29:49 -0700 Subject: [PATCH] Switch important_paths to using result::CargoResult --- src/cargo/util/important_paths.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cargo/util/important_paths.rs b/src/cargo/util/important_paths.rs index 81fce8bd4..ec53e41f4 100644 --- a/src/cargo/util/important_paths.rs +++ b/src/cargo/util/important_paths.rs @@ -1,4 +1,4 @@ -use core::errors::{CargoResult,CargoError,MissingManifest}; +use util::{other_error,CargoResult,CargoError}; pub fn find_project(pwd: Path, file: ~str) -> CargoResult { let mut current = pwd.clone(); @@ -11,5 +11,10 @@ pub fn find_project(pwd: Path, file: ~str) -> CargoResult { if !current.pop() { break; } } - Err(CargoError::internal(MissingManifest(pwd, file))) + Err(manifest_missing_err(&pwd, file.as_slice())) +} + +fn manifest_missing_err(pwd: &Path, file: &str) -> CargoError { + other_error("manifest not found") + .with_detail(format!("pwd={}; file={}", pwd.display(), file)) } -- 2.30.2