mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
docs(frontmatter): Clarify each ScriptSource field's intent
This commit is contained in:
parent
4909d78973
commit
0603e4e3b5
@ -4,12 +4,20 @@ type Span = std::ops::Range<usize>;
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ScriptSource<'s> {
|
pub struct ScriptSource<'s> {
|
||||||
|
/// The full file
|
||||||
raw: &'s str,
|
raw: &'s str,
|
||||||
|
/// The `#!/usr/bin/env cargo` line, if present
|
||||||
shebang: Option<Span>,
|
shebang: Option<Span>,
|
||||||
|
/// The code fence opener (`---`)
|
||||||
open: Option<Span>,
|
open: Option<Span>,
|
||||||
|
/// Trailing text after `ScriptSource::open` that identifies the meaning of
|
||||||
|
/// `ScriptSource::frontmatter`
|
||||||
info: Option<Span>,
|
info: Option<Span>,
|
||||||
|
/// The lines between `ScriptSource::open` and `ScriptSource::close`
|
||||||
frontmatter: Option<Span>,
|
frontmatter: Option<Span>,
|
||||||
|
/// The code fence closer (`---`)
|
||||||
close: Option<Span>,
|
close: Option<Span>,
|
||||||
|
/// All content after the frontmatter and shebang
|
||||||
content: Span,
|
content: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user