File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Tests/PackageLoadingTests Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public extension String {
54
54
}
55
55
56
56
// Otherwise iterate and escape all the single quotes.
57
- var newString = " ' " + String( utf8 [ utf8. startIndex..< singleQuotePos] )
57
+ var newString = " ' " + String( utf8 [ utf8. startIndex..< singleQuotePos] ) !
58
58
59
59
for char in utf8 [ singleQuotePos..< utf8. endIndex] {
60
60
if char == UInt8 ( ascii: " ' " ) {
Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ private struct Lexer {
268
268
break
269
269
}
270
270
}
271
- return . stringLiteral( value: String ( utf8 [ utf8. index ( after: startIndex) ..< endIndex] ) )
271
+ return . stringLiteral( value: String ( utf8 [ utf8. index ( after: startIndex) ..< endIndex] ) ! )
272
272
273
273
// Numeric literals.
274
274
//
@@ -279,7 +279,7 @@ private struct Lexer {
279
279
while let c = look ( ) , c. isNumberChar ( ) {
280
280
let _ = eat ( )
281
281
}
282
- return . number( value: String ( utf8 [ startIndex..< index] ) )
282
+ return . number( value: String ( utf8 [ startIndex..< index] ) ! )
283
283
284
284
// Identifiers.
285
285
case let c where c. isIdentifierChar ( ) :
@@ -289,7 +289,7 @@ private struct Lexer {
289
289
}
290
290
291
291
// Match special strings.
292
- let value : String = String ( utf8 [ startIndex..< index] )
292
+ let value : String = String ( utf8 [ startIndex..< index] ) !
293
293
switch value {
294
294
case " true " :
295
295
return . boolean( value: true )
@@ -761,5 +761,5 @@ public extension TOMLItem {
761
761
/// returns: A list of the lexed tokens' string representations.
762
762
internal func lexTOML( _ data: String ) -> [ String ] {
763
763
let lexer = Lexer ( data)
764
- return lexer. map { String ( $0) }
764
+ return lexer. map { String ( describing : $0) }
765
765
}
Original file line number Diff line number Diff line change @@ -835,7 +835,7 @@ final class PackageBuilderTester {
835
835
// FIXME: Find a better way. Maybe Package can keep array of warnings.
836
836
uncheckedDiagnostics = Set ( warningStream. bytes. asReadableString. characters. split ( separator: " \n " ) . map ( String . init) )
837
837
} catch {
838
- let errorStr = String ( error)
838
+ let errorStr = String ( describing : error)
839
839
result = . error( errorStr)
840
840
uncheckedDiagnostics. insert ( errorStr)
841
841
}
You can’t perform that action at this time.
0 commit comments