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

json: Add fromString and try_fromString functions#217

Merged
evaporei merged 3 commits intomasterfrom
otavio/add-json-from-string
Oct 22, 2021
Merged

json: Add fromString and try_fromString functions#217
evaporei merged 3 commits intomasterfrom
otavio/add-json-from-string

Conversation

@evaporei
Copy link
Contributor

@evaporei evaporei commented Oct 22, 2021

@evaporei evaporei self-assigned this Oct 22, 2021
@evaporei evaporei force-pushed the otavio/add-json-from-string branch from d742bd2 to c84444d Compare October 22, 2021 15:55
@evaporei evaporei requested a review from leoyvens October 22, 2021 16:03

let uint8Array = Uint8Array.wrap(arrayBuffer)

return Bytes.fromUint8Array(uint8Array)
Copy link
Collaborator

Choose a reason for hiding this comment

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

ByteArray.fromUTF8 does the same thing, so this should probably have the same name and reuse the implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh shoot, great observation ❤️

Fixed!

This comment can be removed because String.UTF8.encode
accepts an optional boolean argument related to the null
terminator.
@evaporei evaporei force-pushed the otavio/add-json-from-string branch from 60907bb to 12a9e43 Compare October 22, 2021 19:01
@evaporei evaporei merged commit 0c3230a into master Oct 22, 2021
@leoyvens leoyvens deleted the otavio/add-json-from-string branch October 22, 2021 19:15
@evaporei evaporei mentioned this pull request Oct 26, 2021
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.

2 participants