Convert functions to async/await

This commit is contained in:
Christoph Hagen
2022-10-12 19:28:28 +02:00
parent 7ef5da08d0
commit 26adcc2868
5 changed files with 124 additions and 109 deletions

View File

@@ -0,0 +1,18 @@
//
// File.swift
//
//
// Created by CH on 12.10.22.
//
import Foundation
extension Optional {
func unwrap(or error: @autoclosure () -> Error) throws -> Wrapped {
guard let unwrapped = self else {
throw error()
}
return unwrapped
}
}