Skip to content
Snippets Groups Projects
Commit dac85786 authored by Evy Storozhenko's avatar Evy Storozhenko
Browse files

remove unused code

parent 4f7d3cd4
No related branches found
No related tags found
No related merge requests found
use std::{collections::HashMap, fs};
use anyhow::Result;
fn reverse_string(text: &str) -> String {
text.chars().rev().collect()
}
use std::fs;
fn remove_art(line: &str) -> (u32, u32) {
let patterns = [
......@@ -35,17 +30,13 @@ fn remove_art(line: &str) -> (u32, u32) {
let b = patterns
.iter()
.filter_map(|v| {
if let Some(found) = v
.iter()
.filter_map(|v| reverse_string(&line).find(&reverse_string(v)))
.min()
{
if let Some(found) = v.iter().filter_map(|v| line.rfind(v)).max() {
Some((v[1].parse::<u32>().unwrap(), found))
} else {
None
}
})
.min_by(|x, y| x.1.cmp(&y.1))
.max_by(|x, y| x.1.cmp(&y.1))
.map(|v| v.0.to_owned())
.unwrap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment