From 077e4e33351c6025396b2ae6ce55e30c09d84387 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Wed, 25 Apr 2018 20:36:52 +0200 Subject: [PATCH] Fix warning during compiling tests. Motivation: When compiling the tests the following warning is printed: swift-nio/Tests/NIOTests/SelectorTest.swift:361:43: warning: result of call to 'wait()' is unused }.wait().forEach { return try! $0.wait() } as Void) Modifications: Use XCTAssertNoThrow to silence the warnings. Result: No more warnings. --- Tests/NIOTests/SelectorTest.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/NIOTests/SelectorTest.swift b/Tests/NIOTests/SelectorTest.swift index bcddd31c1f..2e19af08b4 100644 --- a/Tests/NIOTests/SelectorTest.swift +++ b/Tests/NIOTests/SelectorTest.swift @@ -358,7 +358,7 @@ class SelectorTest: XCTestCase { return channel } } - }.wait().forEach { return try! $0.wait() } as Void) + }.wait().forEach { XCTAssertNoThrow(try $0.wait()) } as Void) XCTAssertNoThrow(try everythingWasReadPromise.futureResult.wait()) XCTAssertNoThrow(try FileManager.default.removeItem(at: URL(fileURLWithPath: tempDir))) }