clippy
This commit is contained in:
parent
f9e523f320
commit
734989f1a4
@ -335,7 +335,7 @@ pub fn common_substring<'a>(a: &'a str, b: &'a str) -> Option<String> {
|
|||||||
Some(last_value)
|
Some(last_value)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn chars_take(chars: &Vec<char>, i: usize) -> String {
|
pub fn chars_take(chars: &[char], i: usize) -> String {
|
||||||
if i > chars.len() {
|
if i > chars.len() {
|
||||||
panic!("chars_take: i is larget than chars.len()");
|
panic!("chars_take: i is larget than chars.len()");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ pub fn generate_hint(input: &str) -> String {
|
|||||||
let result_five = get_completion(chars_take(&chars, 5));
|
let result_five = get_completion(chars_take(&chars, 5));
|
||||||
|
|
||||||
if let Some(output) = result_five {
|
if let Some(output) = result_five {
|
||||||
return output.to_owned();
|
return output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ pub fn generate_hint(input: &str) -> String {
|
|||||||
let result_four = get_completion(chars_take(&chars, 4));
|
let result_four = get_completion(chars_take(&chars, 4));
|
||||||
|
|
||||||
if let Some(output) = result_four {
|
if let Some(output) = result_four {
|
||||||
return output.to_owned();
|
return output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,14 +42,14 @@ pub fn generate_hint(input: &str) -> String {
|
|||||||
let result_three = get_completion(chars_take(&chars, 3));
|
let result_three = get_completion(chars_take(&chars, 3));
|
||||||
|
|
||||||
if let Some(output) = result_three {
|
if let Some(output) = result_three {
|
||||||
return output.to_owned();
|
return output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len >= 2 {
|
if len >= 2 {
|
||||||
let result_two = get_completion(chars_take(&chars, 2));
|
let result_two = get_completion(chars_take(&chars, 2));
|
||||||
if let Some(output) = result_two {
|
if let Some(output) = result_two {
|
||||||
return output.to_owned();
|
return output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,10 +214,7 @@ mod tests {
|
|||||||
for (key, value) in manual_values {
|
for (key, value) in manual_values {
|
||||||
values.insert(
|
values.insert(
|
||||||
key.to_string(),
|
key.to_string(),
|
||||||
match value {
|
value.map(|x| x.to_string()),
|
||||||
Some(x) => Some(x.to_string()),
|
|
||||||
None => None,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user