Skip to content

Commit 640e12c

Browse files
committed
refactor(frontmatter): Pull out common span
1 parent 42027af commit 640e12c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cargo/util/toml/embedded.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ pub(super) fn expand_manifest(content: &str) -> Result<String, FrontmatterError>
1010
match source.info() {
1111
Some("cargo") | None => {}
1212
Some(other) => {
13+
let info_span = source.info_span().unwrap();
1314
if let Some(remainder) = other.strip_prefix("cargo,") {
1415
return Err(FrontmatterError::new(
1516
format!("unsupported frontmatter infostring attributes: `{remainder}`"),
16-
source.info_span().unwrap(),
17+
info_span,
1718
));
1819
} else {
1920
return Err(FrontmatterError::new(
2021
format!(
2122
"unsupported frontmatter infostring `{other}`; specify `cargo` for embedding a manifest"
2223
),
23-
source.info_span().unwrap(),
24+
info_span,
2425
));
2526
}
2627
}

0 commit comments

Comments
 (0)