Can anybody please confirm, that this usage of "fallthrough" is eligible? (the code compiles)
extension URLRequest {
init(url: URL, httpMethod: HTTPMethod, token: String? = nil) {
switch httpMethod {
case .post(let body), .put(let body?):
guard let httpBody = try? body.encode() else { fallthrough }
self.init(url, httpMethod.name, httpBody, "application/json", token)
default:
self.init(url, httpMethod.name, nil, nil, token)
}
}
}