Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
fix unnamed include diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
Sky9x committed Nov 24, 2023
1 parent cfcebb6 commit da97492
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/front_matter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn parse_filename(name: Option<String>, mut path: String) -> Result<NavElem> {
path.truncate(path.len() - 2);
Ok(NavElem::Include { name, path })
} else {
Err(anyhow!("include {path} must specify a filename"))
Err(anyhow!("include {path} must specify a name"))
}
}

Expand All @@ -57,7 +57,7 @@ fn parse_filename(name: Option<String>, mut path: String) -> Result<NavElem> {
}

_ => {
if name.is_some() {
if name.is_none() {
bail!("{path} must be a .md file or a folder/");
} else {
bail!("{path} must be a .md file, a folder/, or an include/*");
Expand Down

0 comments on commit da97492

Please sign in to comment.