Skip to content

Address clippy lints currently in beta #3292

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 1 commit into from
Feb 13, 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: 1 addition & 1 deletion src/bin/server.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![warn(clippy::all, rust_2018_idioms)]
#![allow(clippy::unknown_clippy_lints)]
#![allow(unknown_lints)]

use cargo_registry::{boot, App, Env};
use std::{
Expand Down
12 changes: 6 additions & 6 deletions src/models/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ pub enum VersionAction {
Unyank = 2,
}

impl Into<&'static str> for VersionAction {
fn into(self) -> &'static str {
match self {
impl From<VersionAction> for &'static str {
fn from(action: VersionAction) -> Self {
match action {
VersionAction::Publish => "publish",
VersionAction::Yank => "yank",
VersionAction::Unyank => "unyank",
}
}
}

impl Into<String> for VersionAction {
fn into(self) -> String {
let string: &'static str = self.into();
impl From<VersionAction> for String {
fn from(action: VersionAction) -> Self {
let string: &'static str = action.into();

string.into()
}
Expand Down
4 changes: 2 additions & 2 deletions src/models/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ impl User {
/// Queries the database for the verified emails
/// belonging to a given user
pub fn verified_email(&self, conn: &PgConnection) -> QueryResult<Option<String>> {
Ok(Email::belonging_to(self)
Email::belonging_to(self)
.select(emails::email)
.filter(emails::verified.eq(true))
.first(&*conn)
.optional()?)
.optional()
}

/// Queries for the email belonging to a particular user
Expand Down