Skip to content

BTree supports Codable - #38

Open
bogdad wants to merge 1 commit into
attaswift:masterfrom
bogdad:btree_codable_support
Open

BTree supports Codable#38
bogdad wants to merge 1 commit into
attaswift:masterfrom
bogdad:btree_codable_support

Conversation

@bogdad

@bogdad bogdad commented Feb 16, 2020

Copy link
Copy Markdown

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

codecov Bot commented Feb 16, 2020

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@407fda7). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #38   +/-   ##
=========================================
  Coverage          ?   98.56%           
=========================================
  Files             ?       18           
  Lines             ?     6057           
  Branches          ?        0           
=========================================
  Hits              ?     5970           
  Misses            ?       87           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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