http-downloader
http-downloader copied to clipboard
运行 readme_example 报错
系统 : macOS 13.6.2 Rustc 1.74.0
执行cargo run来测试时,报如下错误:
$ RUST_BACKTRACE=1 cargo run
warning: unused import: `Instant`
--> src/extensions/speed_tracker.rs:2:27
|
2 | use std::time::{Duration, Instant};
| ^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: variable does not need to be mutable
--> src/extensions/speed_tracker.rs:90:13
|
90 | let mut downloaded_len_receiver = self.downloaded_len_receiver.clone();
| ----^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: `http-downloader` (lib) generated 2 warnings (run `cargo fix --lib -p http-downloader` to apply 2 suggestions)
Compiling readme_example v0.1.0 (/opt/www/workspace/github/http-downloader/examples/readme_example)
Finished dev [unoptimized + debuginfo] target(s) in 1.23s
Running `/opt/www/workspace/github/http-downloader/target/debug/readme_example`
2023-12-05T04:53:12.170928Z INFO readme_example: Prepare download,准备下载
2023-12-05T04:53:12.171332Z INFO http_downloader::extensions::status_tracker: Status changed Pending(Starting)
2023-12-05T04:53:12.171419Z INFO http_downloader::extensions::status_tracker: Status changed Pending(Initializing)
2023-12-05T04:53:12.171658Z INFO readme_example: Start downloading until the end,开始下载直到结束
2023-12-05T04:53:12.523279Z INFO readme_example: Total size: 452.70 Mb
2023-12-05T04:53:12.523468Z INFO readme_example: Download Progress: 0 %,0/474694696
2023-12-05T04:53:12.526035Z INFO http_downloader::extensions::status_tracker: Status changed Running
thread 'main' panicked at src/chunk_item.rs:177:17:
assertion `left == right` failed
left: 605
right: 10485760
stack backtrace:
0: rust_begin_unwind
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
1: core::panicking::panic_fmt
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:270:5
4: http_downloader::chunk_item::ChunkItem::download_chunk::{{closure}}::{{closure}}
at /opt/www/workspace/github/http-downloader/src/chunk_item.rs:177:17
5: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll