Skip to content

Commit

Permalink
Unpin time-rs and bump MSRV to 1.51
Browse files Browse the repository at this point in the history
As the ecosystem is making no effort to support MSRVs older than about 6
months, keeping a pin on a base crate like time just causes more
problems than it solves.

Bump the version we use in our lints and tests to 1.51 and fix the few
new Clippy items that brings up.
  • Loading branch information
bradfier committed Dec 22, 2021
1 parent a799b49 commit 772f84a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
rust:
- stable
- nightly
- 1.48
- 1.51
features:
- default
- ssl
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ serde = "1"
serde_derive = "1"
serde_json = "1"
sha1 = "0.6.0"
time = { version = "=0.3.2", features = [ "local-offset" ] }
time = { version = "0.3.5", features = [ "local-offset" ] }
tiny_http = "0.8.1"
url = "2"
threadpool = "1"
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.48"
msrv = "1.51"
4 changes: 2 additions & 2 deletions src/content_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub fn apply(request: &Request, mut response: Response) -> Response {
let encoding_preference = ["br", "gzip", "x-gzip", "identity"];
let accept_encoding_header = request.header("Accept-Encoding").unwrap_or("");
if let Some(preferred_index) = input::priority_header_preferred(
&accept_encoding_header,
accept_encoding_header,
encoding_preference.iter().cloned(),
) {
match encoding_preference[preferred_index] {
Expand All @@ -84,7 +84,7 @@ pub fn apply(request: &Request, mut response: Response) -> Response {
}
}

return response;
response
}

// Returns true if the Content-Type of the response is a type that should be encoded.
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ impl Request {
let param_pairs = self.raw_query_string().split('&');
param_pairs
.filter(|pair| pair.starts_with(name_pattern))
.map(|pair| pair.split('=').skip(1).next().unwrap_or(""))
.map(|pair| pair.split('=').nth(1).unwrap_or(""))
.next()
.map(|value| {
percent_encoding::percent_decode(value.replace("+", " ").as_bytes())
Expand Down

0 comments on commit 772f84a

Please sign in to comment.