Skip to content
This repository was archived by the owner on Jun 21, 2020. It is now read-only.

add encodings fn, zstd support #2

Merged
merged 4 commits into from
May 13, 2019

Conversation

fairingrey
Copy link
Contributor

@fairingrey fairingrey commented May 11, 2019

Changes

This PR adds more features and breaking changes:

  • Adds Zstd as an encoding
  • Adds a function encodings that returns a Vec consisting of tuples containing encodings and their corresponding q-values. This should be helpful for some particular use cases.
  • Removes Encoding::None. parse and encodings now return types Option<Encoding>, where an Option type of None indicates that there is no preference in particular for the given Accept-Encoding header(s).
  • Removes the derive_is_enum_variant crate. I'm... not a huge fan of including it in this crate. Removing it also reduces the overall footprint of this crate.

Checklist

  • tests pass
  • tests and/or benchmarks are included
  • documentation is changed or added

Context

This comes following my previous comment here: #1 (comment)

Further changes were also made following the suggestions here: http-rs/tide#194 (comment)

Semver Changes

More features and breaking changes! Likely still bump the minor version if it hasn't been already (0.2).

@fairingrey fairingrey force-pushed the encodings_vec branch 2 times, most recently from 9d90e7a to dadaa2b Compare May 11, 2019 07:59
removes Encoding::None/Any in lieu of returning the None option type
removes reliance on derive_is_enum_variant (not a fan of including this API)
rewrites a bit of the documentation
Copy link
Member

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

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

This looks really good!

@fairingrey fairingrey merged commit 20ae7ba into http-rs:master May 13, 2019
@fairingrey fairingrey deleted the encodings_vec branch May 13, 2019 18:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants