Skip to content

Commit 11b6bb3

Browse files
committed
fix documentaion for the Unicode.ParseResult
The previous documentation was not accurate. It said that the length of the error returned would be the length of the valid prefix. In case of no valid prefix however the code will still return 1, contrary to the documentation. I fixed the documentation by adding the guarantee that the error length will always be positive and removing the information about the valid prefix as we might want to change the precise algorithm in the future.
1 parent e379ab9 commit 11b6bb3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

stdlib/public/core/UnicodeParser.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ extension Unicode {
2222
/// An encoding error was detected.
2323
///
2424
/// `length` is the number of underlying code units consumed by this
25-
/// error (the length of the longest prefix of a valid encoding
26-
/// sequence that could be recognized).
25+
/// error, guaranteed to be greater than 0.
2726
case error(length: Int)
2827

2928
@inlinable // FIXME(sil-serialize-all)

0 commit comments

Comments
 (0)