# Import flate2 in Rust #CR8: Gzip compression

**URL:** <https://forum.codecrafters.io/t/import-flate2-in-rust-cr8-gzip-compression/414>\
**Category:** Challenges\
**Tags:** challenge:http-server\
**Created:** [May 16, 2024, 8:49pm UTC](https://forum.codecrafters.io/t/import-flate2-in-rust-cr8-gzip-compression/414 "2024-05-16T20:49:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JagritC](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/jagritc/32/360_2.png) [@JagritC](https://forum.codecrafters.io/u/JagritC)\
**Post date:** [May 16, 2024, 8:49pm UTC](https://forum.codecrafters.io/t/import-flate2-in-rust-cr8-gzip-compression/414/1 "2024-05-16T20:49:18Z")

</div>

I’m stuck on the Gzip Compression stage. Most of the solutions (if not all) use flate2 to do encoding but to import Flate2 I need to add flate2 in the Cargo.toml. But in the file it explicitly says not to edit that file. And I even tried ignoring the warning and adding the flate2 in the dependency list, but it broke asking if I have cmake. Not sure what I should do next.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/1X/f5f342a183143c55f9a5fa8075d226356f23a52a.png)

---

<div class="post-metadata">

**Author:** ![JagritC](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/jagritc/32/360_2.png) [@JagritC](https://forum.codecrafters.io/u/JagritC)\
**Post date:** [May 16, 2024, 8:52pm UTC](https://forum.codecrafters.io/t/import-flate2-in-rust-cr8-gzip-compression/414/2 "2024-05-16T20:52:43Z")

</div>

nvm figured it out. I had to run

```auto
cargo add flate2

```

in the console.

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [May 16, 2024, 9:11pm UTC](https://forum.codecrafters.io/t/import-flate2-in-rust-cr8-gzip-compression/414/3 "2024-05-16T21:11:47Z")

</div>

Ah, we have to get around to removing those warnings - we didn’t allow changing dependencies in the last but we do now!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [May 21, 2024, 9:12pm UTC](https://forum.codecrafters.io/t/import-flate2-in-rust-cr8-gzip-compression/414/4 "2024-05-21T21:12:20Z")

</div>

Closed on May 21, 2024, 9:12pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [June 4, 2024, 1:59am UTC](https://forum.codecrafters.io/t/import-flate2-in-rust-cr8-gzip-compression/414/5 "2024-06-04T01:59:41Z")

</div>

Note: I’ve updated the title of this post to include the stage ID (#CR8). You can learn about the stages rename here: [Upcoming change: Stages overhaul](https://forum.codecrafters.io/t/upcoming-change-stages-overhaul/375).
