[XcodeGen] Make 'Byte' comform 'ExpressibleByUnicodeScalarLiteral'

Instead of comparing with 'UnicodeScalar', construct 'Byte' from
literals and compare with them. Make it less evil :)
This commit is contained in:
Rintaro Ishizaki
2025-01-28 21:38:46 -08:00
parent aa0e3dc9ea
commit 2d64ef2528
4 changed files with 10 additions and 34 deletions

View File

@@ -77,10 +77,6 @@ struct ByteScanner {
tryEat(where: { $0 == byte })
}
mutating func tryEat(_ c: UnicodeScalar) -> Bool {
tryEat(where: { $0 == c })
}
mutating func tryEat<S: Sequence>(_ seq: S) -> Bool where S.Element == UInt8 {
let start = cursor
for byte in seq {