Skip to content

Commit 0603e4e

Browse files
committed
docs(frontmatter): Clarify each ScriptSource field's intent
1 parent 4909d78 commit 0603e4e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cargo/util/frontmatter.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@ type Span = std::ops::Range<usize>;
44

55
#[derive(Debug)]
66
pub struct ScriptSource<'s> {
7+
/// The full file
78
raw: &'s str,
9+
/// The `#!/usr/bin/env cargo` line, if present
810
shebang: Option<Span>,
11+
/// The code fence opener (`---`)
912
open: Option<Span>,
13+
/// Trailing text after `ScriptSource::open` that identifies the meaning of
14+
/// `ScriptSource::frontmatter`
1015
info: Option<Span>,
16+
/// The lines between `ScriptSource::open` and `ScriptSource::close`
1117
frontmatter: Option<Span>,
18+
/// The code fence closer (`---`)
1219
close: Option<Span>,
20+
/// All content after the frontmatter and shebang
1321
content: Span,
1422
}
1523

0 commit comments

Comments
 (0)