Skip to content

Commit c8d7c8e

Browse files
committed
rustup-dist: Use Download notifications to track install
People have requested some indication of progress for long-running install steps. This commit uses the new FileReaderWithProgress to provide a progress bar (the length is the compressed component tarball but should be good enough) to provide such feedback. Fixes: #1557 Signed-off-by: Daniel Silverstone <[email protected]>
1 parent 02082f1 commit c8d7c8e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/rustup-dist/src/manifestation.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,18 @@ impl Manifestation {
200200

201201
let gz;
202202
let xz;
203+
let notification_converter = |notification: rustup_utils::Notification| {
204+
notify_handler(Notification::Utils(notification));
205+
};
206+
let reader =
207+
utils::FileReaderWithProgress::new_file(&installer_file, &notification_converter)?;
203208
let package: &Package = match format {
204209
Format::Gz => {
205-
gz = TarGzPackage::new_file(&installer_file, temp_cfg)?;
210+
gz = TarGzPackage::new(reader, temp_cfg)?;
206211
&gz
207212
}
208213
Format::Xz => {
209-
xz = TarXzPackage::new_file(&installer_file, temp_cfg)?;
214+
xz = TarXzPackage::new(reader, temp_cfg)?;
210215
&xz
211216
}
212217
};

0 commit comments

Comments
 (0)