swift-nio
swift-nio copied to clipboard
docs: `String(buffer:)` needs to mention that it will always succeed
https://github.com/apple/swift-nio/blob/154706efd36d8d8a7d030eea9bcbeca56a947c62/Sources/NIOCore/ByteBuffer-conversions.swift#L36
Fails to mention that it will always succeed and adds a Unicode replacement char if non-valid UTF8.
It should also link an API that does validate UTF8
Thanks for highlighting this, it looks like we should do this. I see that the underlying readString method which is used does have some related docs https://github.com/apple/swift-nio/blob/6e02c7a2467cf22526ac54521d4230d8c5890e62/Sources/NIOCore/ByteBuffer-aux.swift#L290 .