From 44a9f89c63567b36aed65d65667732c7b7309225 Mon Sep 17 00:00:00 2001 From: Andy Liu Date: Mon, 13 Nov 2023 14:38:35 +0800 Subject: [PATCH] Update open file process Signed-off-by: Andy Liu --- .../11MoreProjects/Pong/Sources/Pong/Game.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Examples/SwiftIOPlayground/11MoreProjects/Pong/Sources/Pong/Game.swift b/Examples/SwiftIOPlayground/11MoreProjects/Pong/Sources/Pong/Game.swift index 2056941..9e19337 100644 --- a/Examples/SwiftIOPlayground/11MoreProjects/Pong/Sources/Pong/Game.swift +++ b/Examples/SwiftIOPlayground/11MoreProjects/Pong/Sources/Pong/Game.swift @@ -177,8 +177,7 @@ struct PongGame { func readSoundData(from path: String) -> [UInt8] { let headerSize = 0x2C - let _file = try? FileDescriptor.open(path) - guard let file = _file else { + guard let file = try? FileDescriptor.open(path) else { print("Read sound data \(path) failed!") return [] }