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

move from curl to reqwest #61

Closed
wants to merge 3 commits into from

Conversation

jcgruenhage
Copy link
Contributor

Fixes #60

@jcgruenhage
Copy link
Contributor Author

Apparently this breaks rust 1.28 support. How important is that?

@dbrgn
Copy link
Collaborator

dbrgn commented Nov 18, 2018

Very nice! Yeah, I think when I created this program reqwest didn't exist yet 🙂

Apparently this breaks rust 1.28 support. How important is that?

I would like to give some stability guarantees, but so far it has been quite arbitrary. We did want features that were not in Rust 1.0, but whether we pick Rust 1.10, 1.21 or 1.28 is arbitrary.

Therefore I think it would be good to pick the first Rust 2018 version (being 1.31) and stick to that for a while. It would also allow us to opt-in to the Rust 2018 features.

Feel free to bump the minimal required Rust version to 1.30 for now! Make sure to update the reference in the README too.

@jcgruenhage
Copy link
Contributor Author

Taking 1.31 once that is released sounds very good to me. reqwest isn't that old yet, yes, but really nice to use.

src/cache.rs Outdated
}
let mut resp = reqwest::get(&self.url)?;
let mut buf: Vec<u8> = vec![];
resp.copy_to(&mut buf)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The unused_results linter complains here. To avoid, use let _bytes = resp.copy_to(&mut buf)?;.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think about logging it instead? It's not quite the same, but it is getting rid of the linter warning and shouldn't hurt anyway.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, yeah, why not. Something like "Downloaded {} bytes".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I worded it slightly differently, "{} bytes downloaded", but the result is the same ^^

@jcgruenhage
Copy link
Contributor Author

I don't understand the CI failure here.. The log line shouldn't change anything about the behavior when updating the cache, and the previous commit passed those tests.

@dbrgn
Copy link
Collaborator

dbrgn commented Nov 19, 2018

@jcgruenhage since you run the command inside the debug!() macro, it is not executed when debug logs are not enabled 😃

Solution: Assign the number of bytes to a variable and log that.

@jcgruenhage
Copy link
Contributor Author

jcgruenhage commented Nov 19, 2018

Oh, okay. Stupid me. I didn't try without (debug) logging

@jcgruenhage
Copy link
Contributor Author

Interesting, github now shows force pushes. Neat!

@dbrgn
Copy link
Collaborator

dbrgn commented Nov 19, 2018

Interesting, github now shows force pushes. Neat!

Yeah, I noticed that too yesterday. Very nice.

Looks good now, thanks!

dbrgn added a commit that referenced this pull request Nov 19, 2018
@dbrgn
Copy link
Collaborator

dbrgn commented Nov 19, 2018

Merged in d950700

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

Successfully merging this pull request may close these issues.

2 participants