mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
use std::starts_with
instead of iterator logic
This commit is contained in:
parent
86726e03e3
commit
2cabe6546c
3 changed files with 5 additions and 8 deletions
|
@ -92,7 +92,7 @@ impl HasToken for ModuleName<'_> {
|
|||
|
||||
impl HasToken for &str {
|
||||
fn token(&self) -> Token {
|
||||
if self.chars().next().unwrap().is_uppercase() {
|
||||
if self.starts_with(|c: char| c.is_uppercase()) {
|
||||
Token::Type
|
||||
} else {
|
||||
Token::Variable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue