add Deflate from config constructor - #556
Conversation
folkertdev
left a comment
There was a problem hiding this comment.
Nice, thanks!
Because this is public API and user-facing I'm especially nit-picky here
| @@ -312,6 +312,20 @@ impl Deflate { | |||
| } | |||
There was a problem hiding this comment.
Can you make this call Self::new_with_config instead?
| /// tweaking `mem_level` or `strategy` is desired. | ||
| /// | ||
| /// This allocates, so should be done with care. | ||
| pub fn new_from_config(config: DeflateConfig) -> Self { |
There was a problem hiding this comment.
| pub fn new_from_config(config: DeflateConfig) -> Self { | |
| pub fn new_with_config(config: DeflateConfig) -> Self { |
| } | ||
| } | ||
|
|
||
| /// Create a new instance from the provided `DeflateConfig`. |
There was a problem hiding this comment.
| /// Create a new instance from the provided `DeflateConfig`. | |
| /// Create a new instance from the provided [`DeflateConfig`]. |
that'll make it clickable
| /// In most cases it is recommended to use the standard `Deflate::new` constructor unless | ||
| /// tweaking `mem_level` or `strategy` is desired. |
There was a problem hiding this comment.
| /// In most cases it is recommended to use the standard `Deflate::new` constructor unless | |
| /// tweaking `mem_level` or `strategy` is desired. | |
| /// In most cases it is recommended to use the standard [`Deflate::new`] constructor unless | |
| /// tweaking `mem_level` or `strategy` is desired. |
Totally understand - addressed everything, thanks! |
|
Hey @folkertdev, would you mind re-reviewing this? 🙏 |
|
Right, can you rebase and force push? (I had to fix CI) |
|
@folkertdev done! |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Hello! This diff exposes a new constructor on the
Deflatestruct allowing users to create an instance directly with a setDeflateConfig.I found myself needing this, as I'd like to use
Deflatewith a specificmem_levelset, which I'm unable to do with the current API.