aboutsummaryrefslogtreecommitdiff
path: root/mingling_pathf/src/error.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-02 04:22:30 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-02 04:22:30 +0800
commit8128f2c94313b2e9b9d0b5c3350623f77bbb2521 (patch)
tree9e542eeaaae148b8cccaa01608d75ed1fc463869 /mingling_pathf/src/error.rs
parent3f24e5b6ead1e153408ae5e58ad34636fe614645 (diff)
chore: run cargo fmt and rearrange re-exports in minglingnext
Diffstat (limited to 'mingling_pathf/src/error.rs')
-rw-r--r--mingling_pathf/src/error.rs31
1 files changed, 19 insertions, 12 deletions
diff --git a/mingling_pathf/src/error.rs b/mingling_pathf/src/error.rs
index 025ceed..513ec23 100644
--- a/mingling_pathf/src/error.rs
+++ b/mingling_pathf/src/error.rs
@@ -24,10 +24,7 @@ pub enum MinglingPathfinderError {
///
/// `file` is the file containing the invalid attribute.
/// `path_attr` is the value of the `#[path]` attribute.
- PathPointsOutside {
- file: PathBuf,
- path_attr: String,
- },
+ PathPointsOutside { file: PathBuf, path_attr: String },
/// No entry point file (`main.rs`, `lib.rs`, or any file under `bin/`) was found.
NoEntryPointFound,
@@ -36,23 +33,33 @@ pub enum MinglingPathfinderError {
///
/// `path` is the file that failed to parse.
/// `message` contains details from the parser.
- SynError {
- path: PathBuf,
- message: String,
- },
+ SynError { path: PathBuf, message: String },
}
impl fmt::Display for MinglingPathfinderError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::IoError(e) => write!(f, "IO error: {e}"),
- Self::ModuleNotFound { parent, module_name } => {
- write!(f, "Module `{module_name}` not found relative to {}", parent.display())
+ Self::ModuleNotFound {
+ parent,
+ module_name,
+ } => {
+ write!(
+ f,
+ "Module `{module_name}` not found relative to {}",
+ parent.display()
+ )
}
Self::PathPointsOutside { file, path_attr } => {
- write!(f, "#[path = \"{path_attr}\"] in {} points outside the project", file.display())
+ write!(
+ f,
+ "#[path = \"{path_attr}\"] in {} points outside the project",
+ file.display()
+ )
+ }
+ Self::NoEntryPointFound => {
+ write!(f, "No entry point found (main.rs, lib.rs, or bin/*.rs)")
}
- Self::NoEntryPointFound => write!(f, "No entry point found (main.rs, lib.rs, or bin/*.rs)"),
Self::SynError { path, message } => {
write!(f, "Failed to parse {}: {message}", path.display())
}