@@ -6,10 +6,11 @@ use std::ffi::OsString;
6
6
use std:: io:: Write ;
7
7
8
8
/// run parses the given itr arguments and triggers the primary program logic.
9
- pub fn run < I , T > ( itr : I , output : & mut ( dyn Write ) ) -> Result < ( ) >
9
+ pub fn run < I , T , W > ( itr : I , output : & mut W ) -> Result < ( ) >
10
10
where
11
11
I : IntoIterator < Item = T > ,
12
12
T : Into < OsString > + Clone ,
13
+ W : Write ,
13
14
{
14
15
exec ( Args :: parse_from ( itr) , output)
15
16
}
@@ -22,9 +23,8 @@ fn run_success() {
22
23
. split_whitespace ( ) ;
23
24
24
25
let mut output_cursor = Cursor :: new ( vec ! [ ] ) ;
25
- let output_writer: & mut ( dyn Write ) = & mut output_cursor;
26
26
27
- run ( itr, output_writer ) . expect ( "to run correctly" ) ;
27
+ run ( itr, & mut output_cursor ) . expect ( "to run correctly" ) ;
28
28
29
29
let buf = output_cursor. into_inner ( ) ;
30
30
let output = match std:: str:: from_utf8 ( & buf) {
@@ -36,7 +36,7 @@ fn run_success() {
36
36
}
37
37
38
38
/// exec makes a HTTP request for the configured URL and constructs a Header for display.
39
- fn exec ( args : Args , output : & mut ( dyn Write ) ) -> Result < ( ) > {
39
+ fn exec < W : Write > ( args : Args , output : & mut W ) -> Result < ( ) > {
40
40
args. color . init ( ) ;
41
41
42
42
let resp = reqwest:: blocking:: get ( & args. url )
0 commit comments