From 525b27df98252edaba42e524dac9c2cd44f3531e Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Wed, 30 Dec 2015 12:42:47 +0100 Subject: [PATCH] Fix formula for the number of chunks. It was rounding to the nearest boundary as opposed to rounding up. This caused the last chunk to not always be downloaded. --- src/audio_file.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio_file.rs b/src/audio_file.rs index 910e322a..f3cb8224 100644 --- a/src/audio_file.rs +++ b/src/audio_file.rs @@ -53,7 +53,7 @@ impl AudioFileLoading { } }).next().unwrap(); - let chunk_count = (size + CHUNK_SIZE / 2) / CHUNK_SIZE; + let chunk_count = (size + CHUNK_SIZE - 1) / CHUNK_SIZE; let shared = Arc::new(AudioFileShared { file_id: file_id,