From ac90892b6031ff00c0fb8df93910342ac1791d12 Mon Sep 17 00:00:00 2001 From: moozzyk Date: Sun, 22 Apr 2018 13:24:51 -0700 Subject: [PATCH] Fixing compilation warnings Fixes: #118 --- Source/WebSocket.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/WebSocket.swift b/Source/WebSocket.swift index 6c22da2..5d1f7bd 100644 --- a/Source/WebSocket.swift +++ b/Source/WebSocket.swift @@ -1024,7 +1024,7 @@ private class InnerWebSocket: Hashable { security = .none } - var path = CFURLCopyPath(req.url! as CFURL!) as String + var path = CFURLCopyPath(req.url! as CFURL) as String if path == "" { path = "/" } @@ -1058,7 +1058,7 @@ private class InnerWebSocket: Hashable { var (rdo, wro) : (InputStream?, OutputStream?) var readStream: Unmanaged? var writeStream: Unmanaged? - CFStreamCreatePairWithSocketToHost(nil, addr[0] as CFString!, UInt32(Int(addr[1])!), &readStream, &writeStream); + CFStreamCreatePairWithSocketToHost(nil, addr[0] as CFString, UInt32(Int(addr[1])!), &readStream, &writeStream); rdo = readStream!.takeRetainedValue() wro = writeStream!.takeRetainedValue() (rd, wr) = (rdo!, wro!) @@ -1144,8 +1144,8 @@ private class InnerWebSocket: Hashable { } else { key = "" if let r = line.range(of: ":") { - key = trim(line.substring(to: r.lowerBound)) - value = trim(line.substring(from: r.upperBound)) + key = trim(String(line[..