pub mod markers;
use thiserror::Error;
pub use self::markers::Markers;
use crate::search::Marker;
use crate::search::StartDirectory;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum DiscoverProjectError {
#[error(
"no project exists at or above `{start}`, because no directory holds any of these markers: {markers}"
)]
#[non_exhaustive]
MissingProject {
start: StartDirectory,
markers: Markers,
},
#[error("the marker `{marker}` is not a relative path inside a searched directory")]
#[non_exhaustive]
OutsideMarker {
marker: Marker,
},
#[error("failed to read the start of the search at `{start}`")]
#[non_exhaustive]
UnreadableStart {
start: StartDirectory,
source: std::io::Error,
},
#[error("failed to determine the working directory of the process")]
#[non_exhaustive]
UnknownWorkingDirectory {
source: std::io::Error,
},
}
#[cfg(test)]
mod tests {
#![allow(clippy::missing_panics_doc)]
use super::*;
#[test]
fn discover_project_error_is_send_and_sync() {
fn assert_send_and_sync<T: Send + Sync>() {}
assert_send_and_sync::<DiscoverProjectError>();
}
}