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

BTree supports Codable #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bogdad
Copy link

@bogdad bogdad commented Feb 16, 2020

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.

@bogdad bogdad force-pushed the btree_codable_support branch 3 times, most recently from 1a87199 to 1fe6ecc Compare February 16, 2020 20:34
@codecov
Copy link

codecov bot commented Feb 16, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@407fda7). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            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.

@bogdad bogdad force-pushed the btree_codable_support branch from 1fe6ecc to 1827029 Compare February 16, 2020 20:36
@bogdad bogdad force-pushed the btree_codable_support branch from 1827029 to 1913568 Compare February 16, 2020 20:48
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.

1 participant