Skip to content
This repository was archived by the owner on Aug 2, 2023. It is now read-only.

added implicit ArraySegment->Spans and explicit ArraySegment<byte>->Utf8String#833

Merged
KrzysztofCwalina merged 2 commits intodotnet:masterfrom
adamsitnik:arraySegmentToSpan
Sep 21, 2016
Merged

added implicit ArraySegment->Spans and explicit ArraySegment<byte>->Utf8String#833
KrzysztofCwalina merged 2 commits intodotnet:masterfrom
adamsitnik:arraySegmentToSpan

Conversation

@adamsitnik
Copy link
Member

@KrzysztofCwalina this should fix #832

{
}

public static explicit operator Utf8String(ArraySegment<byte> arraySegment)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been trying to call such parameters "utf8Bytes" to communicate to callers that they need to ensure that the bytes are actually valid UTF8.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KrzysztofCwalina good point. I have updated the code

@KrzysztofCwalina KrzysztofCwalina merged commit d3ce9ea into dotnet:master Sep 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: Span/ReadOnlySpan / Utf8String operators for ArraySegment<T>

3 participants