Skip to content

Commit 4cd2840

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 11c96cf commit 4cd2840

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
@@ -566,19 +566,19 @@ impl Cursor<'_> {
566566

567567
fn c_or_byte_string(
568568
&mut self,
569-
mk_kind: impl FnOnce(bool) -> LiteralKind,
570-
mk_kind_raw: impl FnOnce(Option<u8>) -> LiteralKind,
569+
mk_kind: fn(bool) -> LiteralKind,
570+
mk_kind_raw: fn(Option<u8>) -> LiteralKind,
571571
single_quoted: Option<fn(bool) -> LiteralKind>,
572572
) -> TokenKind {
573573
match (self.first(), self.second(), single_quoted) {
574-
('\'', _, Some(mk_kind)) => {
574+
('\'', _, Some(single_quoted)) => {
575575
self.bump();
576576
let terminated = self.single_quoted_string();
577577
let suffix_start = self.pos_within_token();
578578
if terminated {
579579
self.eat_literal_suffix();
580580
}
581-
let kind = mk_kind(terminated);
581+
let kind = single_quoted(terminated);
582582
Literal { kind, suffix_start }
583583
}
584584
('"', _, _) => {

0 commit comments

Comments
 (0)