File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,11 @@ fn main_thread(data_lock: Arc<RwLock<DataContainer>>,
71
71
let mut data = DataContainer :: default ( ) ;
72
72
let mut failed_format_counter = 0 ;
73
73
loop {
74
- match clear_rx. recv_timeout ( Duration :: from_millis ( 10 ) ) {
75
- Ok ( cl) => {
76
- if cl {
77
- data = DataContainer :: default ( ) ;
78
- failed_format_counter = 0 ;
79
- }
74
+ if let Ok ( cl) = clear_rx. recv_timeout ( Duration :: from_millis ( 10 ) ) {
75
+ if cl {
76
+ data = DataContainer :: default ( ) ;
77
+ failed_format_counter = 0 ;
80
78
}
81
- Err ( ..) => ( )
82
79
}
83
80
if let Ok ( read_guard) = raw_data_lock. read ( ) {
84
81
let packets = read_guard. clone ( ) ;
@@ -132,12 +129,9 @@ fn main_thread(data_lock: Arc<RwLock<DataContainer>>,
132
129
* write_guard = vec ! [ Packet :: default ( ) ] ;
133
130
}
134
131
135
- match save_rx. recv_timeout ( Duration :: from_millis ( 10 ) ) {
136
- Ok ( fp) => {
137
- file_path = fp;
138
- acquire = true
139
- }
140
- Err ( ..) => ( )
132
+ if let Ok ( fp) = save_rx. recv_timeout ( Duration :: from_millis ( 10 ) ) {
133
+ file_path = fp;
134
+ acquire = true ;
141
135
}
142
136
143
137
if acquire == true {
You can’t perform that action at this time.
0 commit comments