clippy
This commit is contained in:
@@ -1656,35 +1656,31 @@ fn main() {
|
||||
let log_file = PathBuf::from(value_t_or_exit!(arg_matches, "log_path", String));
|
||||
let f = BufReader::new(File::open(log_file).unwrap());
|
||||
println!("Reading log file");
|
||||
for line in f.lines() {
|
||||
if let Ok(line) = line {
|
||||
let parse_results = {
|
||||
if let Some(slot_string) = frozen_regex.captures_iter(&line).next() {
|
||||
Some((slot_string, &mut frozen))
|
||||
} else {
|
||||
full_regex
|
||||
.captures_iter(&line)
|
||||
.next()
|
||||
.map(|slot_string| (slot_string, &mut full))
|
||||
}
|
||||
};
|
||||
for line in f.lines().flatten() {
|
||||
let parse_results = {
|
||||
if let Some(slot_string) = frozen_regex.captures_iter(&line).next() {
|
||||
Some((slot_string, &mut frozen))
|
||||
} else {
|
||||
full_regex
|
||||
.captures_iter(&line)
|
||||
.next()
|
||||
.map(|slot_string| (slot_string, &mut full))
|
||||
}
|
||||
};
|
||||
|
||||
if let Some((slot_string, map)) = parse_results {
|
||||
let slot = slot_string
|
||||
.get(1)
|
||||
.expect("Only one match group")
|
||||
.as_str()
|
||||
.parse::<u64>()
|
||||
.unwrap();
|
||||
if ancestors.contains(&slot) && !map.contains_key(&slot) {
|
||||
map.insert(slot, line);
|
||||
}
|
||||
if slot == ending_slot
|
||||
&& frozen.contains_key(&slot)
|
||||
&& full.contains_key(&slot)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if let Some((slot_string, map)) = parse_results {
|
||||
let slot = slot_string
|
||||
.get(1)
|
||||
.expect("Only one match group")
|
||||
.as_str()
|
||||
.parse::<u64>()
|
||||
.unwrap();
|
||||
if ancestors.contains(&slot) && !map.contains_key(&slot) {
|
||||
map.insert(slot, line);
|
||||
}
|
||||
if slot == ending_slot && frozen.contains_key(&slot) && full.contains_key(&slot)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user