File tree 7 files changed +17
-15
lines changed
7 files changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ impl Exclusion {
16
16
fn walk (
17
17
dir : & Path ,
18
18
exclusion : & Option < Exclusion > ,
19
- cb : & Fn ( & DirEntry ) ,
19
+ cb : & dyn Fn ( & DirEntry ) ,
20
20
recurse : bool ,
21
21
) -> io:: Result < ( ) > {
22
22
for entry in dir. read_dir ( ) ? {
@@ -86,10 +86,9 @@ fn main() -> io::Result<()> {
86
86
)
87
87
. get_matches ( ) ;
88
88
89
- let filter_conf = matches. value_of ( "match" ) . unwrap_or ( "" ) ;
90
89
let recurse = matches. is_present ( "recursive" ) ;
91
90
let exclusions = matches. value_of ( "exclude" ) . map ( |e| Exclusion ( e. into ( ) ) ) ;
92
-
91
+
93
92
match matches. subcommand ( ) {
94
93
( "files" , Some ( subcmd) ) => {
95
94
let path = Path :: new ( subcmd. value_of ( "PATH" ) . unwrap ( ) ) ;
Original file line number Diff line number Diff line change 1
- # Scan this file for changes every 30 seconds
2
1
refresh_rate : 30 seconds
3
2
4
3
appenders :
@@ -20,5 +19,4 @@ loggers:
20
19
special-target :
21
20
level : info
22
21
appenders :
23
- - outfile
24
- additive : false
22
+ - outfile
Original file line number Diff line number Diff line change 1
- 2019-08-20T13:18:17.023781824+02:00 - WARNING, stuff is breaking down
2
- 2019-08-21T18:50:13.813701633+02:00 - WARNING, stuff is breaking down
1
+ 2019-09-01T12:45:25.256922311+02:00 - WARNING, stuff is breaking down
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ fn log_some_stuff() {
50
50
error ! ( "ERROR: stopping ..." ) ;
51
51
}
52
52
53
- const USE_CUSTOM : bool = false ;
53
+ const USE_CUSTOM : bool = true ;
54
54
55
55
fn main ( ) {
56
56
if USE_CUSTOM {
Original file line number Diff line number Diff line change @@ -4,21 +4,27 @@ use std::process::{Command, Stdio};
4
4
5
5
fn main ( ) -> Result < ( ) , Box < dyn Error + Send + Sync + ' static > > {
6
6
let mut ls_child = Command :: new ( "ls" ) ;
7
- ls_child. args ( & [ "-alh" ] ) ;
8
- ls_child. status ( ) ?;
7
+ if !cfg ! ( target_os = "windows" ) {
8
+ ls_child. args ( & [ "-alh" ] ) ;
9
+ }
10
+ println ! ( "{}" , ls_child. status( ) ?) ;
9
11
ls_child. current_dir ( "src/" ) ;
10
-
12
+ println ! ( "{}" , ls_child. status( ) ?) ;
13
+
11
14
let env_child = Command :: new ( "env" )
12
15
. env ( "CANARY" , "0x5ff" )
13
16
. stdout ( Stdio :: piped ( ) )
14
17
. spawn ( ) ?;
15
-
18
+
16
19
let env_output = & env_child. wait_with_output ( ) ?;
17
- let canary = String :: from_utf8_lossy ( & env_output. stdout ) . split_ascii_whitespace ( ) . filter ( |line| * line == "CANARY=0x5ff" ) . count ( ) ;
20
+ let canary = String :: from_utf8_lossy ( & env_output. stdout )
21
+ . split_ascii_whitespace ( )
22
+ . filter ( |line| * line == "CANARY=0x5ff" )
23
+ . count ( ) ;
18
24
19
25
// found it!
20
26
assert_eq ! ( canary, 1 ) ;
21
-
27
+
22
28
let mut rev_child = Command :: new ( "rev" )
23
29
. stdin ( Stdio :: piped ( ) )
24
30
. stdout ( Stdio :: piped ( ) )
You can’t perform that action at this time.
0 commit comments