File tree Expand file tree Collapse file tree 8 files changed +20
-24
lines changed Expand file tree Collapse file tree 8 files changed +20
-24
lines changed Original file line number Diff line number Diff line change 42
42
uses : actions-rs/cargo@v1
43
43
with :
44
44
command : test
45
- args : --all
45
+ args : --all --no-default-features --features file-transport smtp-transport
46
46
47
47
check_fmt_and_docs :
48
48
name : Checking fmt and docs
@@ -64,13 +64,15 @@ jobs:
64
64
run : cargo doc
65
65
66
66
clippy_check :
67
- name : Clippy check
68
67
runs-on : ubuntu-latest
69
68
steps :
70
69
- uses : actions/checkout@v1
71
- - name : Install rust
72
- run : rustup update beta && rustup default beta
73
- - name : Install clippy
74
- run : rustup component add clippy
75
- - name : clippy
76
- run : cargo clippy --all
70
+ - uses : actions-rs/toolchain@v1
71
+ with :
72
+ toolchain : nightly
73
+ components : clippy
74
+ override : true
75
+ - uses : actions-rs/clippy-check@v1
76
+ with :
77
+ token : ${{ secrets.GITHUB_TOKEN }}
78
+ args : --all-features
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ use async_std::fs::File;
9
9
use async_std:: path:: Path ;
10
10
use async_std:: prelude:: * ;
11
11
use async_trait:: async_trait;
12
- use serde_json;
13
12
14
13
use crate :: file:: error:: FileResult ;
15
14
use crate :: Envelope ;
Original file line number Diff line number Diff line change 8
8
unstable_features,
9
9
unused_import_braces,
10
10
missing_debug_implementations,
11
- clippy:: result_unwrap_used,
12
- clippy:: option_unwrap_used
11
+ clippy:: unwrap_used
13
12
) ]
14
13
15
14
pub mod error;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ impl SendmailTransport {
40
40
}
41
41
}
42
42
43
- #[ allow( clippy:: option_unwrap_used ) ]
43
+ #[ allow( clippy:: unwrap_used ) ]
44
44
#[ async_trait]
45
45
impl < ' a > Transport < ' a > for SendmailTransport {
46
46
type Result = SendmailResult ;
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ impl AuthCommand {
285
285
challenge : Option < String > ,
286
286
) -> Result < AuthCommand , Error > {
287
287
let response = if mechanism. supports_initial_response ( ) || challenge. is_some ( ) {
288
- Some ( mechanism. response ( & credentials, challenge. as_ref ( ) . map ( String :: as_str ) ) ?)
288
+ Some ( mechanism. response ( & credentials, challenge. as_deref ( ) ) ?)
289
289
} else {
290
290
None
291
291
} ;
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ impl ServerInfo {
133
133
}
134
134
135
135
let split: Vec < & str > = line. split_whitespace ( ) . collect ( ) ;
136
- match split. get ( 0 ) . map ( |s| * s ) {
136
+ match split. get ( 0 ) . copied ( ) {
137
137
Some ( "8BITMIME" ) => {
138
138
features. insert ( Extension :: EightBitMime ) ;
139
139
}
Original file line number Diff line number Diff line change @@ -166,10 +166,10 @@ impl Response {
166
166
167
167
/// Tells if the response is positive
168
168
pub fn is_positive ( & self ) -> bool {
169
- match self . code . severity {
170
- Severity :: PositiveCompletion | Severity :: PositiveIntermediate => true ,
171
- _ => false ,
172
- }
169
+ matches ! (
170
+ self . code . severity ,
171
+ Severity :: PositiveCompletion | Severity :: PositiveIntermediate
172
+ )
173
173
}
174
174
175
175
/// Tests code equality
Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ impl<'a> SmtpTransport {
407
407
try_smtp ! ( client. command( StarttlsCommand ) . await , self ) ;
408
408
}
409
409
410
- let client = std:: mem:: replace ( & mut self . client , InnerClient :: default ( ) ) ;
410
+ let client = std:: mem:: take ( & mut self . client ) ;
411
411
let ssl_client = client. upgrade_tls_stream ( tls_parameters) . await ?;
412
412
self . client = ssl_client;
413
413
@@ -552,11 +552,7 @@ impl<'a> Transport<'a> for SmtpTransport {
552
552
"{}: conn_use={}, status=sent ({})" ,
553
553
message_id,
554
554
self . state. connection_reuse_count,
555
- result
556
- . message
557
- . iter( )
558
- . next( )
559
- . unwrap_or( & "no response" . to_string( ) )
555
+ result. message. get( 0 ) . unwrap_or( & "no response" . to_string( ) )
560
556
) ;
561
557
}
562
558
You can’t perform that action at this time.
0 commit comments