diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-07-27 13:50:48 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-08-01 08:11:15 +1000 |
| commit | b4fdf648eab9afc797fe5e2d9e30a9660f23d68d (patch) | |
| tree | 43f1b10076d18d4485f5ab95db0bb1f5dfdfe34e /compiler/rustc_lexer/src | |
| parent | bd23d68b4133fdf849544e8cbd866d86b535934d (diff) | |
| download | rust-b4fdf648eab9afc797fe5e2d9e30a9660f23d68d.tar.gz rust-b4fdf648eab9afc797fe5e2d9e30a9660f23d68d.zip | |
Inline `first_token`.
Because it's tiny and hot.
Diffstat (limited to 'compiler/rustc_lexer/src')
| -rw-r--r-- | compiler/rustc_lexer/src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_lexer/src/lib.rs b/compiler/rustc_lexer/src/lib.rs index a41e0374f41..32260913491 100644 --- a/compiler/rustc_lexer/src/lib.rs +++ b/compiler/rustc_lexer/src/lib.rs @@ -221,6 +221,7 @@ pub fn strip_shebang(input: &str) -> Option<usize> { } /// Parses the first token from the provided input string. +#[inline] pub fn first_token(input: &str) -> Token { debug_assert!(!input.is_empty()); Cursor::new(input).advance_token() |
