mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +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)]
|
||||
pub struct ScriptSource<'s> {
|
||||
/// The full file
|
||||
raw: &'s str,
|
||||
/// The `#!/usr/bin/env cargo` line, if present
|
||||
shebang: Option<Span>,
|
||||
/// The code fence opener (`---`)
|
||||
open: Option<Span>,
|
||||
/// Trailing text after `ScriptSource::open` that identifies the meaning of
|
||||
/// `ScriptSource::frontmatter`
|
||||
info: Option<Span>,
|
||||
/// The lines between `ScriptSource::open` and `ScriptSource::close`
|
||||
frontmatter: Option<Span>,
|
||||
/// The code fence closer (`---`)
|
||||
close: Option<Span>,
|
||||
/// All content after the frontmatter and shebang
|
||||
content: Span,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user