Skip to content

Commit 84cc6ce

Browse files
committed
refactor(frontmatter): Publicly expose strip_shebang
1 parent 4483c29 commit 84cc6ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cargo/util/frontmatter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ impl<'s> ScriptSource<'s> {
112112
}
113113
}
114114

115-
fn strip_shebang(input: &str) -> Option<usize> {
115+
/// Returns the index after the shebang line, if present
116+
pub fn strip_shebang(input: &str) -> Option<usize> {
116117
// See rust-lang/rust's compiler/rustc_lexer/src/lib.rs's `strip_shebang`
117118
// Shebang must start with `#!` literally, without any preceding whitespace.
118119
// For simplicity we consider any line starting with `#!` a shebang,

0 commit comments

Comments
 (0)