Skip to content

Commit 5f0e848

Browse files
committed
Auto merge of #3292 - jtgeibel:clippy/1.51-beta, r=Turbo87
Address clippy lints currently in beta r? `@Turbo87`
2 parents feb3651 + cd42366 commit 5f0e848

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/bin/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::all, rust_2018_idioms)]
2-
#![allow(clippy::unknown_clippy_lints)]
2+
#![allow(unknown_lints)]
33

44
use cargo_registry::{boot, App, Env};
55
use std::{

src/models/action.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ pub enum VersionAction {
2020
Unyank = 2,
2121
}
2222

23-
impl Into<&'static str> for VersionAction {
24-
fn into(self) -> &'static str {
25-
match self {
23+
impl From<VersionAction> for &'static str {
24+
fn from(action: VersionAction) -> Self {
25+
match action {
2626
VersionAction::Publish => "publish",
2727
VersionAction::Yank => "yank",
2828
VersionAction::Unyank => "unyank",
2929
}
3030
}
3131
}
3232

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

3737
string.into()
3838
}

src/models/user.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ impl User {
160160
/// Queries the database for the verified emails
161161
/// belonging to a given user
162162
pub fn verified_email(&self, conn: &PgConnection) -> QueryResult<Option<String>> {
163-
Ok(Email::belonging_to(self)
163+
Email::belonging_to(self)
164164
.select(emails::email)
165165
.filter(emails::verified.eq(true))
166166
.first(&*conn)
167-
.optional()?)
167+
.optional()
168168
}
169169

170170
/// Queries for the email belonging to a particular user

0 commit comments

Comments
 (0)