BTree
BTree copied to clipboard
BTree supports Codable
Hey,
thank you for the BTree, I use it in my other pet project and it works flawlessly!
This is an attempt to support of Swift Codable to BTree.
The pull request might be much smaller if Swift Tuple type and Void type supported Codable out of the box. With the current Swift state, tuple support can be fixed "internally", without many changes.
But SortedSet and SortedBag being BTree<Element, Void> is a bummer, as in extension that means, that BTree<Codable, Codable> should be Codable, and BTree<Codable, Void> should be Codable and it appears that is not allowed. Hence the need for EmptyValue.
I understand it is a big code change just to support Codable, so feel free to reject. I would be very excited if we agree on a different workaround for this, looking forward to your comments!
Also, this works with Swift 4.2, what would be the best way to change the Swift version in podspec? Having multiple pods for different versions? To be honest, I am not very familiar with versioning pods for different Swift versions.
Codecov Report
:exclamation: No coverage uploaded for pull request base (
master@407fda7
). Click here to learn what that means. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #38 +/- ##
=========================================
Coverage ? 98.56%
=========================================
Files ? 18
Lines ? 6057
Branches ? 0
=========================================
Hits ? 5970
Misses ? 87
Partials ? 0
Impacted Files | Coverage Δ | |
---|---|---|
Tests/BTreeTests/ListTests.swift | 100% <ø> (ø) |
|
Tests/BTreeTests/SortedSetTests.swift | 99.81% <ø> (ø) |
|
Tests/BTreeTests/SortedBagTests.swift | 99.75% <ø> (ø) |
|
Tests/BTreeTests/BTreeNodeTests.swift | 100% <ø> (ø) |
|
Tests/BTreeTests/MapTests.swift | 100% <ø> (ø) |
|
Tests/BTreeTests/BTreeTests.swift | 98.48% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 407fda7...1913568. Read the comment docs.