We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f37b719 commit 47a20d3Copy full SHA for 47a20d3
1 file changed
source/code2text/src/main.rs
@@ -149,9 +149,6 @@ fn gen_words(
149
let map_data = Arc::new(Mutex::new(map));
150
151
lines.into_par_iter().for_each(|line| {
152
- let mut v = data.lock().unwrap();
153
- let mut map = map_data.lock().unwrap();
154
-
155
let mut scan: Scanner = Scanner::new(&line);
156
let mut counter = 0;
157
@@ -163,6 +160,11 @@ fn gen_words(
163
160
break;
164
161
}
165
162
ScanResult::Ok(val1) => {
+
+ let mut v = data.lock().unwrap();
+ let mut map = map_data.lock().unwrap();
166
167
168
if stop && v.len() > num {
169
170
0 commit comments