Skip to content

Commit 2c80e6b

Browse files
committed
Drop 82 unused Debug impls
1 parent 97cd269 commit 2c80e6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+70
-82
lines changed

src/admin/delete_crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{admin::dialoguer, db, models::Crate, schema::crates};
33
use clap::Clap;
44
use diesel::prelude::*;
55

6-
#[derive(Clap, Debug)]
6+
#[derive(Clap)]
77
#[clap(
88
name = "delete-crate",
99
about = "Purge all references to a crate from the database.",

src/admin/delete_version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
use clap::Clap;
99
use diesel::prelude::*;
1010

11-
#[derive(Clap, Debug)]
11+
#[derive(Clap)]
1212
#[clap(
1313
name = "delete-version",
1414
about = "Purge all references to a crate's version from the database.",

src/admin/migrate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use anyhow::Error;
33
static CATEGORIES_TOML: &'static str = include_str!("../boot/categories.toml");
44
diesel_migrations::embed_migrations!("./migrations");
55

6-
#[derive(clap::Clap, Debug, Copy, Clone)]
6+
#[derive(clap::Clap, Copy, Clone)]
77
#[clap(
88
name = "migrate",
99
about = "Verify config, migrate the database, and other release tasks."

src/admin/on_call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl Event {
5454
}
5555
}
5656

57-
#[derive(serde::Serialize, Debug)]
57+
#[derive(serde::Serialize)]
5858
struct FullEvent {
5959
service_key: String,
6060
#[serde(flatten)]

src/admin/populate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use clap::Clap;
44
use diesel::prelude::*;
55
use rand::{thread_rng, Rng};
66

7-
#[derive(Clap, Debug)]
7+
#[derive(Clap)]
88
#[clap(
99
name = "populate",
1010
about = "Populate a set of dummy download statistics for a specific version in the database."

src/admin/render_readmes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use tar::{self, Archive};
1616

1717
const CACHE_CONTROL_README: &str = "public,max-age=604800";
1818

19-
#[derive(Clap, Debug)]
19+
#[derive(Clap)]
2020
#[clap(
2121
name = "render-readmes",
2222
about = "Iterates over every crate versions ever uploaded and (re-)renders their \

src/admin/test_pagerduty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl FromStr for EventType {
2424
}
2525
}
2626

27-
#[derive(Clap, Debug)]
27+
#[derive(Clap)]
2828
#[clap(name = "test-pagerduty", about = "Send a test event to pagerduty")]
2929
pub struct Opts {
3030
#[clap(possible_values = &["trigger", "acknowledge", "resolve"])]

src/admin/transfer_crates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::process::exit;
99
use clap::Clap;
1010
use diesel::prelude::*;
1111

12-
#[derive(Clap, Debug)]
12+
#[derive(Clap)]
1313
#[clap(
1414
name = "transfer-crates",
1515
about = "Transfer all crates from one user to another."

src/admin/verify_token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::{db, models::User, util::errors::AppResult};
22

33
use clap::Clap;
44

5-
#[derive(Clap, Debug)]
5+
#[derive(Clap)]
66
#[clap(
77
name = "verify-token",
88
about = "Look up a username by API token.",

src/bin/crates-admin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ use cargo_registry::admin::{
77

88
use clap::Clap;
99

10-
#[derive(Clap, Debug)]
10+
#[derive(Clap)]
1111
#[clap(name = "crates-admin")]
1212
struct Opts {
1313
#[clap(subcommand)]
1414
command: SubCommand,
1515
}
1616

17-
#[derive(Clap, Debug)]
17+
#[derive(Clap)]
1818
enum SubCommand {
1919
DeleteCrate(delete_crate::Opts),
2020
DeleteVersion(delete_version::Opts),

src/boot/categories.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::db;
66
use anyhow::{Context, Result};
77
use diesel::prelude::*;
88

9-
#[derive(Debug)]
109
struct Category {
1110
slug: String,
1211
name: String,

src/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::publish_rate_limit::PublishRateLimit;
22
use crate::{env, env_optional, uploaders::Uploader, Env, Replica};
33

4-
#[derive(Debug)]
54
pub struct Config {
65
pub uploader: Uploader,
76
pub session_key: String,
@@ -28,7 +27,6 @@ pub struct Config {
2827
pub instance_metrics_log_every_seconds: Option<u64>,
2928
}
3029

31-
#[derive(Debug)]
3230
pub struct DbPoolConfig {
3331
pub url: String,
3432
pub read_only_mode: bool,

src/controllers/helpers/pagination.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ impl<T: 'static> IntoIterator for Paginated<T> {
189189
}
190190
}
191191

192-
#[derive(Debug)]
193192
pub(crate) struct PaginatedQuery<T> {
194193
query: T,
195194
options: PaginationOptions,

src/controllers/util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::util::errors::{
1010
InsecurelyGeneratedTokenRevoked,
1111
};
1212

13-
#[derive(Debug)]
1413
pub struct AuthenticatedUser {
1514
user: User,
1615
token_id: Option<i32>,

src/downloads_counter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::sync::atomic::{AtomicI64, AtomicUsize, Ordering};
2222
/// persisted, so it's possible to lose some of them if the process exits ungracefully. While
2323
/// that's far from ideal, the advantage of batching database updates far outweights potentially
2424
/// losing some download counts.
25-
#[derive(Debug)]
2625
pub struct DownloadsCounter {
2726
/// Inner storage for the download counts.
2827
inner: DashMap<i32, AtomicUsize>,

src/email.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use lettre::transport::smtp::authentication::{Credentials, Mechanism};
88
use lettre::transport::smtp::SmtpTransport;
99
use lettre::{Message, Transport};
1010

11-
#[derive(Debug)]
1211
pub struct Emails {
1312
backend: EmailBackend,
1413
}

src/git.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Credentials {
5252
}
5353
}
5454

55-
#[derive(Serialize, Deserialize, Debug)]
55+
#[derive(Serialize, Deserialize)]
5656
pub struct Crate {
5757
pub name: String,
5858
pub vers: String,
@@ -64,7 +64,7 @@ pub struct Crate {
6464
pub links: Option<String>,
6565
}
6666

67-
#[derive(Serialize, Deserialize, Debug)]
67+
#[derive(Serialize, Deserialize)]
6868
pub struct Dependency {
6969
pub name: String,
7070
pub req: String,

src/github.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use std::str;
1010
use crate::util::errors::{cargo_err, internal, not_found, AppError, AppResult};
1111
use reqwest::blocking::Client;
1212

13-
#[derive(Debug)]
1413
pub struct GitHubClient {
1514
base_url: String,
1615
client: Option<Client>,

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub mod views;
6464
/// The app's `config.env` value is set in *src/bin/server.rs* to `Production` if the environment
6565
/// variable `HEROKU` is set and `Development` otherwise. `config.env` is set to `Test`
6666
/// unconditionally in *src/test/all.rs*.
67-
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
67+
#[derive(PartialEq, Eq, Clone, Copy)]
6868
pub enum Env {
6969
Development,
7070
Test,
@@ -82,7 +82,7 @@ pub enum Env {
8282
///
8383
/// There may be more ways to run crates.io servers in the future, such as a
8484
/// mirror that also has private crates that crates.io does not have.
85-
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
85+
#[derive(PartialEq, Eq, Clone, Copy)]
8686
pub enum Replica {
8787
Primary,
8888
ReadOnlyMirror,

src/middleware/debug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use super::prelude::*;
44

5-
#[derive(Clone, Copy, Debug)]
5+
#[derive(Clone, Copy)]
66
pub struct Debug;
77

88
impl Middleware for Debug {
@@ -21,7 +21,7 @@ impl Middleware for Debug {
2121
}
2222
}
2323

24-
#[derive(Clone, Copy, Debug)]
24+
#[derive(Clone, Copy)]
2525
struct DebugRequest;
2626

2727
impl Middleware for DebugRequest {

src/models/category.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use diesel::{self, *};
44
use crate::models::Crate;
55
use crate::schema::*;
66

7-
#[derive(Clone, Identifiable, Queryable, QueryableByName, Debug)]
7+
#[derive(Clone, Identifiable, Queryable, QueryableByName)]
88
#[table_name = "categories"]
99
pub struct Category {
1010
pub id: i32,
@@ -28,7 +28,7 @@ type WithSlugsCaseSensitive<'a> = diesel::dsl::Eq<
2828
>;
2929
type BySlugsCaseSensitive<'a> = diesel::dsl::Filter<categories::table, WithSlugsCaseSensitive<'a>>;
3030

31-
#[derive(Associations, Insertable, Identifiable, Debug, Clone, Copy)]
31+
#[derive(Associations, Insertable, Identifiable, Clone, Copy)]
3232
#[belongs_to(Category)]
3333
#[belongs_to(Crate)]
3434
#[table_name = "crates_categories"]
@@ -138,7 +138,7 @@ impl Category {
138138

139139
/// Struct for inserting categories; only used in tests. Actual categories are inserted
140140
/// in src/boot/categories.rs.
141-
#[derive(Insertable, AsChangeset, Default, Debug)]
141+
#[derive(Insertable, AsChangeset, Default)]
142142
#[table_name = "categories"]
143143
pub struct NewCategory<'a> {
144144
pub category: &'a str,

src/models/crate_owner_invitation.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ use crate::models::{CrateOwner, OwnerKind};
66
use crate::schema::{crate_owner_invitations, crate_owners, crates};
77
use crate::util::errors::{AppResult, OwnershipInvitationExpired};
88

9-
#[derive(Debug)]
109
pub enum NewCrateOwnerInvitationOutcome {
1110
AlreadyExists,
1211
InviteCreated { plaintext_token: String },
1312
}
1413

1514
/// The model representing a row in the `crate_owner_invitations` database table.
16-
#[derive(Clone, Debug, PartialEq, Eq, Identifiable, Queryable)]
15+
#[derive(Clone, PartialEq, Eq, Identifiable, Queryable)]
1716
#[primary_key(invited_user_id, crate_id)]
1817
pub struct CrateOwnerInvitation {
1918
pub invited_user_id: i32,
@@ -32,7 +31,7 @@ impl CrateOwnerInvitation {
3231
conn: &PgConnection,
3332
config: &Config,
3433
) -> AppResult<NewCrateOwnerInvitationOutcome> {
35-
#[derive(Insertable, Clone, Copy, Debug)]
34+
#[derive(Insertable, Clone, Copy)]
3635
#[table_name = "crate_owner_invitations"]
3736
struct NewRecord {
3837
invited_user_id: i32,

src/models/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::models::Version;
22
use crate::schema::version_downloads;
33
use chrono::NaiveDate;
44

5-
#[derive(Queryable, Identifiable, Associations, Debug, Clone, Copy)]
5+
#[derive(Queryable, Identifiable, Associations, Clone, Copy)]
66
#[belongs_to(Version)]
77
#[primary_key(version_id, date)]
88
pub struct VersionDownload {

src/models/follow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::models::User;
22
use crate::schema::follows;
33

4-
#[derive(Insertable, Queryable, Identifiable, Associations, Clone, Copy, Debug)]
4+
#[derive(Insertable, Queryable, Identifiable, Associations, Clone, Copy)]
55
#[belongs_to(User)]
66
#[primary_key(user_id, crate_id)]
77
#[table_name = "follows"]

src/models/helpers/with_count.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(QueryableByName, Queryable, Debug)]
1+
#[derive(QueryableByName, Queryable)]
22
pub struct WithCount<T> {
33
#[diesel(embed)]
44
pub(crate) record: T,

src/models/keyword.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ use diesel::prelude::*;
44
use crate::models::Crate;
55
use crate::schema::*;
66

7-
#[derive(Clone, Identifiable, Queryable, Debug)]
7+
#[derive(Clone, Identifiable, Queryable)]
88
pub struct Keyword {
99
pub id: i32,
1010
pub keyword: String,
1111
pub crates_cnt: i32,
1212
pub created_at: NaiveDateTime,
1313
}
1414

15-
#[derive(Associations, Insertable, Identifiable, Debug, Clone, Copy)]
15+
#[derive(Associations, Insertable, Identifiable, Clone, Copy)]
1616
#[belongs_to(Keyword)]
1717
#[belongs_to(Crate)]
1818
#[table_name = "crates_keywords"]

src/models/krate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type WithName<'a> = diesel::dsl::Eq<CanonCrateName<crates::name>, CanonCrateName
7878
type ByName<'a> = diesel::dsl::Filter<All, WithName<'a>>;
7979
type ByExactName<'a> = diesel::dsl::Filter<All, diesel::dsl::Eq<crates::name, &'a str>>;
8080

81-
#[derive(Insertable, AsChangeset, Default, Debug)]
81+
#[derive(Insertable, AsChangeset, Default)]
8282
#[table_name = "crates"]
8383
#[changeset_options(treat_none_as_null = "true")]
8484
#[primary_key(name, max_upload_size)] // This is actually just to skip updating them

src/models/owner.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::util::errors::{cargo_err, AppResult};
77
use crate::models::{Crate, Team, User};
88
use crate::schema::{crate_owners, users};
99

10-
#[derive(Insertable, Associations, Identifiable, Debug, Clone, Copy)]
10+
#[derive(Insertable, Associations, Identifiable, Clone, Copy)]
1111
#[belongs_to(Crate)]
1212
#[belongs_to(User, foreign_key = "owner_id")]
1313
#[belongs_to(Team, foreign_key = "owner_id")]
@@ -44,7 +44,6 @@ pub enum OwnerKind {
4444
}
4545

4646
/// Unifies the notion of a User or a Team.
47-
#[derive(Debug)]
4847
pub enum Owner {
4948
User(User),
5049
Team(Team),

src/models/rights.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// Access rights to the crate (publishing and ownership management)
22
/// NOTE: The order of these variants matters!
3-
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Clone, Copy)]
3+
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
44
pub enum Rights {
55
None,
66
Publish,

src/models/team.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::schema::{crate_owners, teams};
1010

1111
/// For now, just a Github Team. Can be upgraded to other teams
1212
/// later if desirable.
13-
#[derive(Queryable, Identifiable, Serialize, Deserialize, Debug)]
13+
#[derive(Queryable, Identifiable, Serialize, Deserialize)]
1414
pub struct Team {
1515
/// Unique table id
1616
pub id: i32,
@@ -29,7 +29,7 @@ pub struct Team {
2929
pub org_id: Option<i32>,
3030
}
3131

32-
#[derive(Insertable, AsChangeset, Debug)]
32+
#[derive(Insertable, AsChangeset)]
3333
#[table_name = "teams"]
3434
pub struct NewTeam<'a> {
3535
pub login: &'a str,

src/models/user.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct User {
2323
}
2424

2525
/// Represents a new user record insertable to the `users` table
26-
#[derive(Insertable, Debug, Default)]
26+
#[derive(Insertable, Default)]
2727
#[table_name = "users"]
2828
pub struct NewUser<'a> {
2929
pub gh_id: i32,

src/models/version.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::models::{Crate, Dependency, User};
99
use crate::schema::*;
1010

1111
// Queryable has a custom implementation below
12-
#[derive(Clone, Identifiable, Associations, Debug, Queryable, Deserialize, Serialize)]
12+
#[derive(Clone, Identifiable, Associations, Queryable, Deserialize, Serialize)]
1313
#[belongs_to(Crate)]
1414
pub struct Version {
1515
pub id: i32,
@@ -25,7 +25,7 @@ pub struct Version {
2525
pub published_by: Option<i32>,
2626
}
2727

28-
#[derive(Insertable, Debug)]
28+
#[derive(Insertable)]
2929
#[table_name = "versions"]
3030
pub struct NewVersion {
3131
crate_id: i32,

src/s3/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::time::Duration;
1111

1212
pub use reqwest::Error;
1313

14-
#[derive(Clone, Debug)]
14+
#[derive(Clone)]
1515
pub struct Bucket {
1616
name: String,
1717
region: Option<String>,

0 commit comments

Comments
 (0)