Skip to content

Commit 9f84032

Browse files
committed
Auto merge of #4072 - Turbo87:edition, r=JohnTitor
Rust 2021 Edition This PR updates the Rust version that we use to v1.56.0 and sets the `edition` field to 2021. see https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html
2 parents 8ab929a + ac2f2f4 commit 9f84032

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ jobs:
7777
- name: Install Rust
7878
run: |
7979
rustup set profile minimal
80-
# Pin to older version until a clippy regression is fixed
81-
rustup update 1.54.0
82-
rustup default 1.54.0
80+
rustup update 1.56.0
81+
rustup default 1.56.0
8382
8483
- run: rustup component add rustfmt
8584
- run: rustup component add clippy

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ version = "0.2.2"
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/rust-lang/crates.io"
77
description = "Backend of crates.io"
8-
edition = "2018"
9-
resolver = "2"
8+
edition = "2021"
109
default-run = "server"
1110

1211
[workspace]

RustConfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION=1.54.0
1+
VERSION=1.56.0

src/controllers/krate/publish.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub fn publish(req: &mut dyn RequestExt) -> EndpointResult {
7575
// Create a transaction on the database, if there are no errors,
7676
// commit the transactions to record a new or updated crate.
7777
conn.transaction(|| {
78+
let _ = &new_crate;
7879
let name = new_crate.name;
7980
let vers = &*new_crate.vers;
8081
let links = new_crate.links;

src/tests/record.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ fn replay_http(
326326
}
327327

328328
async {
329+
let _ = &exchange;
329330
assert_eq!(
330331
to_bytes(req.into_body()).await.unwrap(),
331332
base64::decode(&exchange.request.body).unwrap()

src/util/errors/json.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ impl fmt::Display for ServiceUnavailable {
136136

137137
impl AppError for TooManyRequests {
138138
fn response(&self) -> Option<AppResponse> {
139-
use std::convert::TryInto;
140-
141139
const HTTP_DATE_FORMAT: &str = "%a, %d %b %Y %H:%M:%S GMT";
142140
let retry_after = self.retry_after.format(HTTP_DATE_FORMAT);
143141

0 commit comments

Comments
 (0)