Skip to content

Commit 63d3bbc

Browse files
committed
Auto merge of #1702 - sgrif:sg-fix-redundant-imports, r=jtgeibel
Fix new lint on nightly `unused_imports` now triggers for redundant imports. `diesel::Connection` is part of `diesel::prelude`, `mem::drop` is part of `std::prelude`, and `InvitationResponse` was explicitly imported at the top of the file
2 parents 7ef5d56 + c165578 commit 63d3bbc

File tree

3 files changed

+0
-5
lines changed

3 files changed

+0
-5
lines changed

src/db.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ impl Deref for DieselPooledConn<'_> {
5757
}
5858

5959
pub fn connect_now() -> ConnectionResult<PgConnection> {
60-
use diesel::Connection;
6160
let mut url = Url::parse(&crate::env("DATABASE_URL")).expect("Invalid database URL");
6261
if dotenv::var("HEROKU").is_ok() && !url.query_pairs().any(|(k, _)| k == "sslmode") {
6362
url.query_pairs_mut().append_pair("sslmode", "require");

src/middleware/current_user.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ pub enum AuthenticationSource {
2020

2121
impl Middleware for CurrentUser {
2222
fn before(&self, req: &mut dyn Request) -> Result<(), Box<dyn Error + Send>> {
23-
use std::mem::drop;
24-
2523
// Check if the request has a session cookie with a `user_id` property inside
2624
let id = {
2725
req.session()

src/tests/owners.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ impl crate::util::MockCookieUser {
3434
/// As the currently logged in user, accept an invitation to become an owner of the named
3535
/// crate.
3636
fn accept_ownership_invitation(&self, krate_name: &str, krate_id: i32) {
37-
use cargo_registry::views::InvitationResponse;
38-
3937
let body = json!({
4038
"crate_owner_invite": {
4139
"invited_by_username": "",

0 commit comments

Comments
 (0)