File tree 3 files changed +9
-9
lines changed
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
#![ warn( clippy:: all, rust_2018_idioms) ]
2
- #![ allow( clippy :: unknown_clippy_lints ) ]
2
+ #![ allow( unknown_lints ) ]
3
3
4
4
use cargo_registry:: { boot, App , Env } ;
5
5
use std:: {
Original file line number Diff line number Diff line change @@ -20,19 +20,19 @@ pub enum VersionAction {
20
20
Unyank = 2 ,
21
21
}
22
22
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 {
26
26
VersionAction :: Publish => "publish" ,
27
27
VersionAction :: Yank => "yank" ,
28
28
VersionAction :: Unyank => "unyank" ,
29
29
}
30
30
}
31
31
}
32
32
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 ( ) ;
36
36
37
37
string. into ( )
38
38
}
Original file line number Diff line number Diff line change @@ -160,11 +160,11 @@ impl User {
160
160
/// Queries the database for the verified emails
161
161
/// belonging to a given user
162
162
pub fn verified_email ( & self , conn : & PgConnection ) -> QueryResult < Option < String > > {
163
- Ok ( Email :: belonging_to ( self )
163
+ Email :: belonging_to ( self )
164
164
. select ( emails:: email)
165
165
. filter ( emails:: verified. eq ( true ) )
166
166
. first ( & * conn)
167
- . optional ( ) ? )
167
+ . optional ( )
168
168
}
169
169
170
170
/// Queries for the email belonging to a particular user
You can’t perform that action at this time.
0 commit comments