Compile on Swift 5.3

This commit is contained in:
Kare Morstol
2020-07-08 15:25:21 +02:00
parent 4da45e4e6f
commit bfddee7c95
2 changed files with 2 additions and 7 deletions
+2 -2
View File
@@ -60,7 +60,7 @@ If the file already exists and overwrite=false, the writing will begin at the en
- parameter overwrite: If true, replace the file if it exists.
*/
public func open(forWriting path: URL, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream {
public func open(forWriting path: URL, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> FileHandleStream {
if overwrite || !Files.fileExists(atPath: path.path) {
try Files.createDirectory(at: path.deletingLastPathComponent(), withIntermediateDirectories: true, attributes: nil)
@@ -83,7 +83,7 @@ If the file already exists and overwrite=false, the writing will begin at the en
- parameter overwrite: If true, replace the file if it exists.
*/
public func open(forWriting path: String, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream {
public func open(forWriting path: String, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> FileHandleStream {
let fixedpath = path.hasPrefix("~") ? NSString(string: path).expandingTildeInPath : path
return try open(forWriting: URL(fileURLWithPath: fixedpath, isDirectory: false), overwrite: overwrite, encoding: encoding)
}
-5
View File
@@ -85,11 +85,6 @@ extension ReadableStream {
while let text = self.readSome() { target.write(text) }
}
/// Writes the text in this stream to the given WritableStream.
public func write(to target: inout WritableStream) {
while let text = self.readSome() { target.write(text) }
}
#if !(os(iOS) || os(tvOS) || os(watchOS))
public var context: Context {
var context = CustomContext(main)