Skip to content

Commit

Permalink
fix: use collect() instead of for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyCpp committed May 8, 2021
1 parent 6022ac7 commit 94422be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opentelemetry-otlp/tests/grpc_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ fn build_content_map() -> HashMap<PathBuf, String> {
let dict =
std::fs::read_dir("src/proto/grpcio").expect("cannot open dict of generated grpc files");

for entry in dict.into_iter().flatten() {
let _ = dict.into_iter().flatten().map(|entry|{
map.insert(
entry.path(),
std::fs::read_to_string(entry.path()).unwrap_or_else(|_| {
panic!("cannot read from file {}", entry.path().to_string_lossy())
}),
);
}
}).collect::<Vec<()>>();
map
}

0 comments on commit 94422be

Please sign in to comment.