Skip to content

Commit f02463b

Browse files
committed
fix(toml): Don't error on infostrings with trailing whitespace
1 parent 8d83b06 commit f02463b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/cargo/util/toml/embedded.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ 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();
248249
if !info.is_empty() {
249-
source.info = Some(info.trim_end());
250+
source.info = Some(info);
250251
}
251252
source.content = content;
252253

@@ -431,9 +432,7 @@ Ok(
431432
shebang: Some(
432433
"#!/usr/bin/env cargo\r\n",
433434
),
434-
info: Some(
435-
"",
436-
),
435+
info: None,
437436
frontmatter: Some(
438437
"[dependencies]\r\ntime=\"0.1.25\"\r\n",
439438
),

0 commit comments

Comments
 (0)