Skip to content

Commit

Permalink
Fix object_store lint (#2367)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Aug 8, 2022
1 parent 3f5ab6b commit beaef5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/object_store.yml
Expand Up @@ -44,7 +44,7 @@ jobs:
rustup component add clippy
- name: Run clippy
run: |
cargo clippy -p object_store --all-features
cargo clippy -p object_store --all-features -- -D warnings
# test the crate
linux-test:
Expand Down
7 changes: 3 additions & 4 deletions object_store/src/util.rs
Expand Up @@ -84,8 +84,8 @@ pub async fn coalesce_ranges<F, Fut>(
coalesce: usize,
) -> Result<Vec<Bytes>>
where
F: FnMut(std::ops::Range<usize>) -> Fut,
Fut: std::future::Future<Output = Result<Bytes>>,
F: Send + FnMut(std::ops::Range<usize>) -> Fut,
Fut: std::future::Future<Output = Result<Bytes>> + Send,
{
let mut ret = Vec::with_capacity(ranges.len());
let mut start_idx = 0;
Expand All @@ -105,8 +105,7 @@ where
let start = ranges[start_idx].start;
let end = ranges[end_idx - 1].end;
let bytes = fetch(start..end).await?;
for i in start_idx..end_idx {
let range = ranges[i].clone();
for range in ranges.iter().take(end_idx).skip(start_idx) {
ret.push(bytes.slice(range.start - start..range.end - start))
}
start_idx = end_idx;
Expand Down

0 comments on commit beaef5c

Please sign in to comment.