Skip to content

Commit 634d38b

Browse files
committed
Clean up c_or_byte_string.
- Rename a misleading local `mk_kind` as `single_quoted`. - Use `fn` for all three arguments, for consistency.
1 parent fd0f446 commit 634d38b

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_lexer/src

1 file changed

+4
-4
lines changed

compiler/rustc_lexer/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -574,19 +574,19 @@ impl Cursor<'_> {
574574

575575
fn c_or_byte_string(
576576
&mut self,
577-
mk_kind: impl FnOnce(bool) -> LiteralKind,
578-
mk_kind_raw: impl FnOnce(Option<u8>) -> LiteralKind,
577+
mk_kind: fn(bool) -> LiteralKind,
578+
mk_kind_raw: fn(Option<u8>) -> LiteralKind,
579579
single_quoted: Option<fn(bool) -> LiteralKind>,
580580
) -> TokenKind {
581581
match (self.first(), self.second(), single_quoted) {
582-
('\'', _, Some(mk_kind)) => {
582+
('\'', _, Some(single_quoted)) => {
583583
self.bump();
584584
let terminated = self.single_quoted_string();
585585
let suffix_start = self.pos_within_token();
586586
if terminated {
587587
self.eat_literal_suffix();
588588
}
589-
let kind = mk_kind(terminated);
589+
let kind = single_quoted(terminated);
590590
Literal { kind, suffix_start }
591591
}
592592
('"', _, _) => {

0 commit comments

Comments
 (0)