Skip to content

Commit 7e28c6b

Browse files
committed
fixup
1 parent 0d0e4db commit 7e28c6b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Sources/Basics/FileSystem+Extensions.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import class Foundation.FileManager
1212
import struct Foundation.Data
1313
import TSCBasic
14-
import PackageDescription
1514

1615
// MARK: - user level
1716

@@ -121,10 +120,7 @@ extension FileSystem {
121120
}
122121

123122
public func readFileContents(_ path: AbsolutePath) throws -> String {
124-
guard let string = try String(data: self.readFileContents(path), encoding: .utf8) else {
125-
throw StringError("invalid UTF8 string")
126-
}
127-
return string
123+
return try String(decoding: self.readFileContents(path), as: UTF8.self)
128124
}
129125

130126
public func writeFileContents(_ path: AbsolutePath, data: Data) throws {

0 commit comments

Comments
 (0)