Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Swift 5 / Xcode 11 #3

Merged
merged 2 commits into from Aug 15, 2020
Merged

Migrate to Swift 5 / Xcode 11 #3

merged 2 commits into from Aug 15, 2020

Conversation

ephread
Copy link
Contributor

@ephread ephread commented Aug 14, 2020

This PR fixes all issues reported by Xcode 11.6.

Due to the deprecation of…

func withUnsafeBytes<ResultType, ContentType>(_ body: (UnsafePointer<ContentType>) throws -> ResultType) rethrows -> ResultType

… I used Michael Tsai's approach to bind the memory from UnsafeRawBufferPointer to a UnsafePointer<ContentType> reference.

I wonder if I should handle the case on an empty Data (count == 0) instance in toPointer() though. 🤔

I hope the PR is small enough, let me know what you think!

@onmyway133
Copy link
Owner

@ephread Thanks for the PR, I like it. Working with pointer in Swift is not fun 😄 I think for empty data we end up creating no xml children, so I guess that is fine for now

@onmyway133 onmyway133 merged commit 23f1f82 into onmyway133:master Aug 15, 2020
@ephread
Copy link
Contributor Author

ephread commented Aug 15, 2020

Sweet, thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants