From b6db31de17d70b33ec2e552d74f2e7312e5c0d89 Mon Sep 17 00:00:00 2001 From: Guoye Zhang Date: Wed, 19 Jun 2024 19:33:03 -0700 Subject: [PATCH] Remove mutating --- Sources/HTTPTypes/HTTPParsedFields.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/HTTPTypes/HTTPParsedFields.swift b/Sources/HTTPTypes/HTTPParsedFields.swift index a993714..e40341e 100644 --- a/Sources/HTTPTypes/HTTPParsedFields.swift +++ b/Sources/HTTPTypes/HTTPParsedFields.swift @@ -100,7 +100,7 @@ struct HTTPParsedFields { } var request: HTTPRequest { - mutating get throws { + get throws { guard let method = self.method else { throw ParsingError.requestWithoutMethod } @@ -120,7 +120,7 @@ struct HTTPParsedFields { } var response: HTTPResponse { - mutating get throws { + get throws { guard let statusString = self.status?._storage else { throw ParsingError.responseWithoutStatus } @@ -136,7 +136,7 @@ struct HTTPParsedFields { } var trailerFields: HTTPFields { - mutating get throws { + get throws { if self.method != nil || self.scheme != nil || self.authority != nil || self.path != nil || self.extendedConnectProtocol != nil || self.status != nil { throw ParsingError.responseWithRequestPseudo }