@@ -493,7 +493,7 @@ extension String {
493
493
self = String . _fromNonContiguousUnsafeBitcastUTF8Repairing ( codeUnits) . 0
494
494
}
495
495
496
- /// Creates a new `String` by copying and validating the sequence of
496
+ /// Creates a new string by copying and validating the sequence of
497
497
/// code units passed in, according to the specified encoding.
498
498
///
499
499
/// This initializer does not try to repair ill-formed code unit sequences.
@@ -553,8 +553,8 @@ extension String {
553
553
}
554
554
}
555
555
556
- /// Creates a new `String` by copying and validating the sequence of
557
- /// `Int8` passed in, according to the specified encoding.
556
+ /// Creates a new string by copying and validating the sequence of
557
+ /// code units passed in, according to the specified encoding.
558
558
///
559
559
/// This initializer does not try to repair ill-formed code unit sequences.
560
560
/// If any are found, the result of the initializer is `nil`.
@@ -596,9 +596,7 @@ extension String {
596
596
597
597
// slow-path
598
598
let uint8s = codeUnits. lazy. map ( UInt8 . init ( bitPattern: ) )
599
- let string = String ( validating: uint8s, as: Encoding . self)
600
- guard let string else { return nil }
601
- self = string
599
+ self . init ( validating: uint8s, as: Encoding . self)
602
600
}
603
601
604
602
/// Creates a new string with the specified capacity in UTF-8 code units, and
0 commit comments