Skip to content

Requesting parse function that takes in Data instead of String #272

Open
@bjo0

Description

@bjo0

It would be convenient to have a version of the parse func that took in Data instead of String, as the conversion of Data to String involves transiting an Optional<String> function (String(data: encoding:)). This maybe looks superficially like not an inconvenience, but in practice it means I have to make my own error type in order to propagate failures at this step. If SwiftSoup did it and implemented the error type, it would improve ergonomics.

The function signature might be something like this:

func parse(data: Data) throws -> Document

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions