Auto merge of #80499 - matthiaskrgr:red_clos, r=estebank

remove redundant closures (clippy::redundant_closure)
This commit is contained in:
bors 2021-01-12 11:20:47 +00:00
commit fc9944fe84
10 changed files with 41 additions and 44 deletions

View file

@ -12,7 +12,7 @@ macro_rules! test {
let (lines, multi_byte_chars, non_narrow_chars) =
analyze_source_file($text, BytePos($source_file_start_pos));
let expected_lines: Vec<BytePos> = $lines.into_iter().map(|pos| BytePos(pos)).collect();
let expected_lines: Vec<BytePos> = $lines.into_iter().map(BytePos).collect();
assert_eq!(lines, expected_lines);

View file

@ -4,7 +4,7 @@ use super::*;
fn test_lev_distance() {
use std::char::{from_u32, MAX};
// Test bytelength agnosticity
for c in (0..MAX as u32).filter_map(|i| from_u32(i)).map(|i| i.to_string()) {
for c in (0..MAX as u32).filter_map(from_u32).map(|i| i.to_string()) {
assert_eq!(lev_distance(&c[..], &c[..]), 0);
}