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

Added DownloadStatus convenience #454

Merged
merged 10 commits into from
Jul 29, 2021
Merged

Added DownloadStatus convenience #454

merged 10 commits into from
Jul 29, 2021

Conversation

julianrex
Copy link
Contributor

PRs must be submitted under the terms of our Contributor License Agreement CLA.

Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Add example if relevant.
  • Document any changes to public APIs.
  • Apply changelog label ('breaking change', 'bug 🪲', 'build', 'docs', 'feature 🍏', 'performance ⚡', 'testing 💯') or use the label 'skip changelog'
  • Add an entry inside this element for inclusion in the mapbox-maps-ios changelog: <changelog></changelog>.
  • Update the migration guide, API Docs, Markdown files - Readme, Developing, etc

Summary of changes

User impact (optional)

@jmkiley jmkiley marked this pull request as ready for review July 21, 2021 20:50
Comment on lines +61 to +65
/// Convenience to initialize a `DownloadStatus` when the download state is `.pending`
///
/// - Parameters:
/// - error: Contains error information in case of failure when state is
/// set to `DownloadState.failed`.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is confusing. If this initializer is for use with download state pending, why would you ever provide an error if that's only for the failed state?

Copy link
Contributor

@macdrevx macdrevx left a comment

Choose a reason for hiding this comment

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

Pausing my review. I think the test improvements are the most important. Remodeling DownloadStatus as an enum can be deferred, since that seems outside of the scope here (refining an existing construct vs wrapping it in a new one).

…sTests.swift

Co-authored-by: Andrew Hershberger <andrew.hershberger@mapbox.com>
@jmkiley jmkiley merged commit 3cbf3d8 into main Jul 29, 2021
@jmkiley jmkiley deleted the jrex/download-status branch July 29, 2021 16:05
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.

3 participants