about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/scanner.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-02-27T09·27+0200
committertazjin <mail@tazj.in>2021-02-27T13·05+0000
commit75750ba6835ae8ac3a97c24ca7ff5ebc1500f36d (patch)
tree35138b7ae42bcb6668b982224f6d5f3febbeafa6 /users/tazjin/rlox/src/scanner.rs
parentebc987f4aaf653c227d21bec5998c62e87da7f7b (diff)
style(tazjin/rlox): Set max_width=80 r/2235
Change-Id: Ib64831c0b97c94fdfbdbae64f4dfccc86879ef73
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2554
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'users/tazjin/rlox/src/scanner.rs')
-rw-r--r--users/tazjin/rlox/src/scanner.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/users/tazjin/rlox/src/scanner.rs b/users/tazjin/rlox/src/scanner.rs
index 314b56d6d380..4e8f07b61f5e 100644
--- a/users/tazjin/rlox/src/scanner.rs
+++ b/users/tazjin/rlox/src/scanner.rs
@@ -106,9 +106,15 @@ impl<'a> Scanner<'a> {
 
             // possible multi-character tokens
             '!' => self.add_if_next('=', TokenKind::BangEqual, TokenKind::Bang),
-            '=' => self.add_if_next('=', TokenKind::EqualEqual, TokenKind::Equal),
+            '=' => {
+                self.add_if_next('=', TokenKind::EqualEqual, TokenKind::Equal)
+            }
             '<' => self.add_if_next('=', TokenKind::LessEqual, TokenKind::Less),
-            '>' => self.add_if_next('=', TokenKind::GreaterEqual, TokenKind::Greater),
+            '>' => self.add_if_next(
+                '=',
+                TokenKind::GreaterEqual,
+                TokenKind::Greater,
+            ),
 
             '/' => {
                 // support comments until EOL by discarding characters
@@ -228,7 +234,8 @@ impl<'a> Scanner<'a> {
             self.advance();
         }
 
-        let ident: String = self.source[self.start..self.current].iter().collect();
+        let ident: String =
+            self.source[self.start..self.current].iter().collect();
 
         // Determine whether this is an identifier, or a keyword:
         let token_kind = match ident.as_str() {