From 2b9469b5931eab56c9abcbb4fa46fdf0197ff21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Wei=C3=9F?= Date: Wed, 2 May 2018 14:33:41 +0100 Subject: [PATCH] fix warning in new ByteBuffer test (#377) Motivation: there was a new, avoidable warning in a ByteBuffer test. Modifications: fix the warning Result: fewer warnings --- Tests/NIOTests/ByteBufferTest.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/NIOTests/ByteBufferTest.swift b/Tests/NIOTests/ByteBufferTest.swift index a73e8f4d5..e448baf67 100644 --- a/Tests/NIOTests/ByteBufferTest.swift +++ b/Tests/NIOTests/ByteBufferTest.swift @@ -1323,13 +1323,14 @@ class ByteBufferTest: XCTestCase { XCTAssertEqual(0xaa, buffer.readInteger(as: UInt8.self)) XCTAssertEqual(0, buffer.readableBytes) - var buffer2 = buffer + let buffer2 = buffer XCTAssertTrue(buffer.discardReadBytes()) XCTAssertEqual(0, buffer.readerIndex) XCTAssertEqual(0, buffer.writerIndex) // As we fully consumed the buffer we should only have adjusted the indices but not triggered a copy as result of CoW sematics. // So we should still be able to also read the old data. XCTAssertEqual(0xaa, buffer.getInteger(at: 0, as: UInt8.self)) + XCTAssertEqual(0, buffer2.readableBytes) } func testDumpBytesFormat() throws {