File tree 2 files changed +5
-12
lines changed 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -73,10 +73,9 @@ pub fn got_symlink_permission(tmpdir: &TempDir) -> bool {
73
73
let link = tmpdir. join ( "some_hopefully_unique_link_name" ) ;
74
74
75
75
match symlink_file ( r"nonexisting_target" , link) {
76
- Ok ( _) => true ,
77
76
// ERROR_PRIVILEGE_NOT_HELD = 1314
78
77
Err ( ref err) if err. raw_os_error ( ) == Some ( 1314 ) => false ,
79
- Err ( _) => true ,
78
+ Ok ( _ ) | Err ( _) => true ,
80
79
}
81
80
}
82
81
Original file line number Diff line number Diff line change @@ -152,19 +152,13 @@ fn udp_clone_two_write() {
152
152
let ( done, rx) = channel ( ) ;
153
153
let tx2 = tx. clone ( ) ;
154
154
let _t = thread:: spawn ( move || {
155
- match sock3. send_to ( & [ 1 ] , & addr2) {
156
- Ok ( ..) => {
157
- let _ = tx2. send ( ( ) ) ;
158
- }
159
- Err ( ..) => { }
155
+ if sock3. send_to ( & [ 1 ] , & addr2) . is_ok ( ) {
156
+ let _ = tx2. send ( ( ) ) ;
160
157
}
161
158
done. send ( ( ) ) . unwrap ( ) ;
162
159
} ) ;
163
- match sock1. send_to ( & [ 2 ] , & addr2) {
164
- Ok ( ..) => {
165
- let _ = tx. send ( ( ) ) ;
166
- }
167
- Err ( ..) => { }
160
+ if sock1. send_to ( & [ 2 ] , & addr2) . is_ok ( ) {
161
+ let _ = tx. send ( ( ) ) ;
168
162
}
169
163
drop ( tx) ;
170
164
You can’t perform that action at this time.
0 commit comments