diff --git a/src/bin/server.rs b/src/bin/server.rs index fbbef992f33..f5ba462809a 100644 --- a/src/bin/server.rs +++ b/src/bin/server.rs @@ -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::{ diff --git a/src/models/action.rs b/src/models/action.rs index cd19f918e77..266e91c681e 100644 --- a/src/models/action.rs +++ b/src/models/action.rs @@ -20,9 +20,9 @@ pub enum VersionAction { Unyank = 2, } -impl Into<&'static str> for VersionAction { - fn into(self) -> &'static str { - match self { +impl From for &'static str { + fn from(action: VersionAction) -> Self { + match action { VersionAction::Publish => "publish", VersionAction::Yank => "yank", VersionAction::Unyank => "unyank", @@ -30,9 +30,9 @@ impl Into<&'static str> for VersionAction { } } -impl Into for VersionAction { - fn into(self) -> String { - let string: &'static str = self.into(); +impl From for String { + fn from(action: VersionAction) -> Self { + let string: &'static str = action.into(); string.into() } diff --git a/src/models/user.rs b/src/models/user.rs index 46e3af307b5..1172bb90e06 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -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> { - 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