Skip to content

Cleanup unneeded lints and drop unused Debug impls #3717

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

Merged
merged 2 commits into from
Jun 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ use scheduled_thread_pool::ScheduledThreadPool;

/// The `App` struct holds the main components of the application like
/// the database connection pool and configurations
// The db, oauth, and git2 types don't implement debug.
#[allow(missing_debug_implementations)]
pub struct App {
/// The primary database connection pool
pub primary_database: DieselPool,
Expand Down
1 change: 0 additions & 1 deletion src/background_jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ impl swirl::db::DieselPool for DieselPool {
}
}

#[allow(missing_debug_implementations)]
pub struct Environment {
index: Arc<Mutex<Repository>>,
pub uploader: Uploader,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/enqueue-job.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(clippy::all)]
#![warn(clippy::all, rust_2018_idioms)]

use anyhow::{anyhow, Result};
use cargo_registry::{db, env, tasks};
Expand Down
1 change: 0 additions & 1 deletion src/bin/server.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![warn(clippy::all, rust_2018_idioms)]
#![allow(unknown_lints)]

use cargo_registry::{metrics::LogEncoder, util::errors::AppResult, App, Env};
use std::{borrow::Cow, fs::File, process::Command, sync::Arc, time::Duration};
Expand Down
2 changes: 0 additions & 2 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use url::Url;

use crate::middleware::app::RequestApp;

#[allow(missing_debug_implementations)]
#[derive(Clone)]
pub enum DieselPool {
Pool(r2d2::Pool<ConnectionManager<PgConnection>>),
Expand Down Expand Up @@ -104,7 +103,6 @@ pub struct PoolState {
pub idle_connections: u32,
}

#[allow(missing_debug_implementations)]
pub enum DieselPooledConn<'a> {
Pool(r2d2::PooledConnection<ConnectionManager<PgConnection>>),
Test(ReentrantMutexGuard<'a, PgConnection>),
Expand Down
2 changes: 0 additions & 2 deletions src/git.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(missing_debug_implementations)]

use std::collections::HashMap;
use std::fs::{self, OpenOptions};
use std::path::{Path, PathBuf};
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//! [krate](krate/index.html), [user](user/index.html) and [version](version/index.html) modules.

#![warn(clippy::all, rust_2018_idioms)]
#![warn(missing_debug_implementations, missing_copy_implementations)]

#[cfg(test)]
#[macro_use]
Expand Down
2 changes: 0 additions & 2 deletions src/middleware/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use crate::App;
use std::sync::Arc;

/// Middleware that injects the `App` instance into the `Request` extensions
// Can't derive Debug because `App` can't.
#[allow(missing_debug_implementations)]
pub struct AppMiddleware {
app: Arc<App>,
}
Expand Down
2 changes: 0 additions & 2 deletions src/middleware/block_traffic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ use super::prelude::*;
use crate::App;
use std::sync::Arc;

// Can't derive debug because of Handler.
#[allow(missing_debug_implementations)]
#[derive(Default)]
pub struct BlockTraffic {
header_name: String,
Expand Down
2 changes: 0 additions & 2 deletions src/middleware/head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use super::prelude::*;
use crate::util::RequestProxy;
use conduit::Method;

// Can't derive debug because of Handler.
#[allow(missing_debug_implementations)]
#[derive(Default)]
pub struct Head {
handler: Option<Box<dyn Handler>>,
Expand Down
2 changes: 0 additions & 2 deletions src/middleware/require_user_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ use std::env;

use crate::util::request_header;

// Can't derive debug because of Handler.
#[allow(missing_debug_implementations)]
#[derive(Default)]
pub struct RequireUserAgent {
cdn_user_agent: String,
Expand Down
2 changes: 0 additions & 2 deletions src/middleware/static_or_continue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use super::prelude::*;

use conduit_static::Static;

// Can't derive debug because of Handler and Static.
#[allow(missing_debug_implementations)]
pub struct StaticOrContinue {
fallback_handler: Option<Box<dyn Handler>>,
static_handler: Static,
Expand Down
1 change: 0 additions & 1 deletion src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::background_jobs::Environment;
use crate::models::Version;

/// Context for markdown to HTML rendering.
#[allow(missing_debug_implementations)]
struct MarkdownRenderer<'a> {
html_sanitizer: Builder<'a>,
}
Expand Down
2 changes: 0 additions & 2 deletions src/util/request_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use conduit::{Method, RequestExt};

type RequestMutRef<'a> = &'a mut (dyn RequestExt + 'a);

// Can't derive Debug because of Request.
#[allow(missing_debug_implementations)]
pub struct RequestProxy<'a> {
other: RequestMutRef<'a>,
method: conduit::Method,
Expand Down