@@ -350,7 +350,7 @@ extension StructuredFieldValueParser {
350350 // Unquoted dquote, this is the end of the string.
351351 endIndex = index
352352 break loop
353- case 0x00 ... 0x1F , 0x7F ... :
353+ case 0x00 ... 0x1F , 0x7F ... :
354354 // Forbidden bytes in string: string must be VCHAR and SP.
355355 throw StructuredHeaderError . invalidString
356356 default :
@@ -365,7 +365,7 @@ extension StructuredFieldValueParser {
365365 if endIndex == self . underlyingData. endIndex {
366366 throw StructuredHeaderError . invalidString
367367 }
368- let stringSlice = self . underlyingData [ self . underlyingData. startIndex ..< index]
368+ let stringSlice = self . underlyingData [ self . underlyingData. startIndex..< index]
369369 self . underlyingData. formIndex ( after: & index)
370370 self . underlyingData = self . underlyingData [ index... ]
371371
@@ -426,7 +426,10 @@ extension StructuredFieldValueParser {
426426 }
427427
428428 private mutating func _parseAToken( ) throws -> RFC9651 BareItem {
429- assert ( asciiCapitals. contains ( self . underlyingData. first!) || asciiLowercases. contains ( self . underlyingData. first!) || self . underlyingData. first! == asciiAsterisk)
429+ assert (
430+ asciiCapitals. contains ( self . underlyingData. first!) || asciiLowercases. contains ( self . underlyingData. first!)
431+ || self . underlyingData. first! == asciiAsterisk
432+ )
430433
431434 var index = self . underlyingData. startIndex
432435 loop: while index < self . underlyingData. endIndex {
@@ -438,12 +441,12 @@ extension StructuredFieldValueParser {
438441 // / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
439442 // / DIGIT / ALPHA
440443 //
441- // The following insane case statement covers this. Tokens suck .
444+ // The following unfortunate case statement covers this. Tokens; not even once .
442445 case asciiExclamationMark, asciiOctothorpe, asciiDollar, asciiPercent,
443- asciiAmpersand, asciiSquote, asciiAsterisk, asciiPlus, asciiDash,
444- asciiPeriod, asciiCaret, asciiUnderscore, asciiBacktick, asciiPipe,
445- asciiTilde, asciiDigits, asciiCapitals, asciiLowercases,
446- asciiColon, asciiSlash:
446+ asciiAmpersand, asciiSquote, asciiAsterisk, asciiPlus, asciiDash,
447+ asciiPeriod, asciiCaret, asciiUnderscore, asciiBacktick, asciiPipe,
448+ asciiTilde, asciiDigits, asciiCapitals, asciiLowercases,
449+ asciiColon, asciiSlash:
447450 // Good, consume
448451 self . underlyingData. formIndex ( after: & index)
449452 default :
@@ -522,7 +525,8 @@ extension RandomAccessCollection where Element == UInt8, SubSequence == Self {
522525extension String {
523526 // This is the slow path, so we never inline this.
524527 @inline ( never)
525- fileprivate static func decodingEscapes< Bytes: RandomAccessCollection > ( _ bytes: Bytes , escapes: Int ) -> String where Bytes. Element == UInt8 {
528+ fileprivate static func decodingEscapes< Bytes: RandomAccessCollection > ( _ bytes: Bytes , escapes: Int ) -> String
529+ where Bytes. Element == UInt8 {
526530 // We assume the string is previously validated, so the escapes are easily removed. See the doc comment for
527531 // `StrippingStringEscapesCollection` for more details on what we're doing here.
528532 let unescapedBytes = StrippingStringEscapesCollection ( bytes, escapes: escapes)
@@ -545,7 +549,8 @@ extension String {
545549/// Until this issue is fixed (https://bugs.swift.org/browse/SR-13111) we take a different approach: we use
546550/// `String.init(unsafeUninitializedCapacity:initializingWith)`. This is an unsafe function, so to reduce the unsafety as much
547551/// as possible we define this safe wrapping Collection and then use `copyBytes` to implement the initialization.
548- private struct StrippingStringEscapesCollection< BaseCollection: Rando mAccessCollection> where BaseCollection. Element == UInt8 {
552+ private struct StrippingStringEscapesCollection< BaseCollection: Rando mAccessCollection>
553+ where BaseCollection. Element == UInt8 {
549554 private var base: BaseCollection
550555 private var escapes : UInt
551556
0 commit comments