Skip to content

Commit 9ecd75c

Browse files
authored
Merge pull request #567 from CodaFi/bundled-accessories
Updates for SE-0089
2 parents c7ca7c8 + 1e5491d commit 9ecd75c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Sources/Basic/StringConversions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public extension String {
5454
}
5555

5656
// Otherwise iterate and escape all the single quotes.
57-
var newString = "'" + String(utf8[utf8.startIndex..<singleQuotePos])
57+
var newString = "'" + String(utf8[utf8.startIndex..<singleQuotePos])!
5858

5959
for char in utf8[singleQuotePos..<utf8.endIndex] {
6060
if char == UInt8(ascii: "'") {

Sources/Basic/TOML.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ private struct Lexer {
268268
break
269269
}
270270
}
271-
return .stringLiteral(value: String(utf8[utf8.index(after: startIndex)..<endIndex]))
271+
return .stringLiteral(value: String(utf8[utf8.index(after: startIndex)..<endIndex])!)
272272

273273
// Numeric literals.
274274
//
@@ -279,7 +279,7 @@ private struct Lexer {
279279
while let c = look(), c.isNumberChar() {
280280
let _ = eat()
281281
}
282-
return .number(value: String(utf8[startIndex..<index]))
282+
return .number(value: String(utf8[startIndex..<index])!)
283283

284284
// Identifiers.
285285
case let c where c.isIdentifierChar():
@@ -289,7 +289,7 @@ private struct Lexer {
289289
}
290290

291291
// Match special strings.
292-
let value: String = String(utf8[startIndex..<index])
292+
let value: String = String(utf8[startIndex..<index])!
293293
switch value {
294294
case "true":
295295
return .boolean(value: true)
@@ -761,5 +761,5 @@ public extension TOMLItem {
761761
/// returns: A list of the lexed tokens' string representations.
762762
internal func lexTOML(_ data: String) -> [String] {
763763
let lexer = Lexer(data)
764-
return lexer.map { String($0) }
764+
return lexer.map { String(describing: $0) }
765765
}

Tests/PackageLoadingTests/ConventionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ final class PackageBuilderTester {
835835
// FIXME: Find a better way. Maybe Package can keep array of warnings.
836836
uncheckedDiagnostics = Set(warningStream.bytes.asReadableString.characters.split(separator: "\n").map(String.init))
837837
} catch {
838-
let errorStr = String(error)
838+
let errorStr = String(describing: error)
839839
result = .error(errorStr)
840840
uncheckedDiagnostics.insert(errorStr)
841841
}

0 commit comments

Comments
 (0)