@@ -219,17 +219,9 @@ public struct HttpHeaderKey {
219
219
public static let xVerificaSicurezza : HttpHeaderKey = " X-VerificaSicurezza "
220
220
}
221
221
222
- extension HttpHeaderKey : Hashable , Codable , ExpressibleByStringLiteral , StringProtocol , RawRepresentable , CustomStringConvertible {
223
- public typealias UTF8View = String . UTF8View
224
- public typealias UTF16View = String . UTF16View
225
- public typealias UnicodeScalarView = String . UnicodeScalarView
222
+ extension HttpHeaderKey : Hashable , Codable , ExpressibleByStringLiteral , RawRepresentable , CustomStringConvertible {
226
223
227
224
public var description : String { rawValue }
228
- public var startIndex : String . Index { rawValue. startIndex }
229
- public var endIndex : String . Index { rawValue. endIndex }
230
- public var utf8 : String . UTF8View { rawValue. utf8 }
231
- public var utf16 : String . UTF16View { rawValue. utf16 }
232
- public var unicodeScalars : String . UnicodeScalarView { rawValue. unicodeScalars }
233
225
234
226
/// Creates a new instance with the specified raw value.
235
227
/// - Parameter rawValue: The raw value to use for the new instance.
@@ -249,42 +241,7 @@ extension HttpHeaderKey: Hashable, Codable, ExpressibleByStringLiteral, StringPr
249
241
public init ( from decoder: Decoder ) throws {
250
242
try self . init ( String ( from: decoder) )
251
243
}
252
-
253
- /// Creates a string from the given Unicode code units in the specified
254
- /// encoding.
255
- ///
256
- /// - Parameters:
257
- /// - codeUnits: A collection of code units encoded in the encoding
258
- /// specified in `sourceEncoding`.
259
- /// - sourceEncoding: The encoding in which `codeUnits` should be
260
- /// interpreted.
261
-
262
- public init < C, Encoding> ( decoding codeUnits: C , as sourceEncoding: Encoding . Type ) where C : Collection , Encoding : _UnicodeEncoding , C. Element == Encoding . CodeUnit {
263
- self . init ( String ( decoding: codeUnits, as: sourceEncoding) )
264
- }
265
-
266
- /// Creates a string from the null-terminated, UTF-8 encoded sequence of
267
- /// bytes at the given pointer.
268
- ///
269
- /// - Parameter nullTerminatedUTF8: A pointer to a sequence of contiguous,
270
- /// UTF-8 encoded bytes ending just before the first zero byte.
271
- public init ( cString nullTerminatedUTF8: UnsafePointer < CChar > ) {
272
- self . init ( String ( cString: nullTerminatedUTF8) )
273
- }
274
-
275
- /// Creates a string from the null-terminated sequence of bytes at the given
276
- /// pointer.
277
- ///
278
- /// - Parameters:
279
- /// - nullTerminatedCodeUnits: A pointer to a sequence of contiguous code
280
- /// units in the encoding specified in `sourceEncoding`, ending just
281
- /// before the first zero code unit.
282
- /// - sourceEncoding: The encoding in which the code units should be
283
- /// interpreted.
284
- public init < Encoding> ( decodingCString nullTerminatedCodeUnits: UnsafePointer < Encoding . CodeUnit > , as sourceEncoding: Encoding . Type ) where Encoding : _UnicodeEncoding {
285
- self . init ( String ( decodingCString: nullTerminatedCodeUnits, as: sourceEncoding) )
286
- }
287
-
244
+
288
245
/// Hashes the essential components of this value by feeding them into the
289
246
/// given hasher.
290
247
///
@@ -314,44 +271,4 @@ extension HttpHeaderKey: Hashable, Codable, ExpressibleByStringLiteral, StringPr
314
271
public func encode( to encoder: Encoder ) throws {
315
272
try rawValue. encode ( to: encoder)
316
273
}
317
-
318
- public subscript( position: String . Index ) -> Character {
319
- rawValue [ position]
320
- }
321
-
322
- public subscript( bounds: Range < String . Index > ) -> Substring {
323
- rawValue [ bounds]
324
- }
325
-
326
- public mutating func write( _ string: String ) {
327
- rawValue. write ( string)
328
- }
329
-
330
- public func lowercased( ) -> String {
331
- rawValue. lowercased ( )
332
- }
333
-
334
- public func uppercased( ) -> String {
335
- rawValue. uppercased ( )
336
- }
337
-
338
- public func write< Target> ( to target: inout Target ) where Target : TextOutputStream {
339
- rawValue. write ( to: & target)
340
- }
341
-
342
- public func withCString< Result> ( _ body: ( UnsafePointer < CChar > ) throws -> Result ) rethrows -> Result {
343
- try rawValue. withCString ( body)
344
- }
345
-
346
- public func withCString< Result, Encoding> ( encodedAs targetEncoding: Encoding . Type , _ body: ( UnsafePointer < Encoding . CodeUnit > ) throws -> Result ) rethrows -> Result where Encoding : _UnicodeEncoding {
347
- try rawValue. withCString ( encodedAs: targetEncoding, body)
348
- }
349
-
350
- public func index( after i: String . Index ) -> String . Index {
351
- rawValue. index ( after: i)
352
- }
353
-
354
- public func index( before i: String . Index ) -> String . Index {
355
- rawValue. index ( before: i)
356
- }
357
274
}
0 commit comments