Skip to content

Commit 59c5519

Browse files
committed
fix(toml): Don't error on leading whitespace in infostring
According to the [RFC](https://rust-lang.github.io/rfcs/3503-frontmatter.html): > Opens with 3+ dashes followed by 0+ whitespace, > an optional term (one or more characters excluding whitespace and commas), > 0+ whitespace, and a newline
1 parent f02463b commit 59c5519

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cargo/util/toml/embedded.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ fn split_source(input: &str) -> CargoResult<Source<'_>> {
245245
_ => source.content.split_at(fence_end),
246246
};
247247
let (info, content) = rest.split_once("\n").unwrap_or((rest, ""));
248-
let info = info.trim_end();
248+
let info = info.trim();
249249
if !info.is_empty() {
250250
source.info = Some(info);
251251
}
@@ -373,7 +373,7 @@ Ok(
373373
Source {
374374
shebang: None,
375375
info: Some(
376-
" cargo",
376+
"cargo",
377377
),
378378
frontmatter: Some(
379379
"[dependencies]\ntime=\"0.1.25\"\n",

0 commit comments

Comments
 (0)