From bffc7d885b2bb316b42631c593261a6533b0ad6d Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Wed, 3 Jul 2024 16:44:23 +0100 Subject: [PATCH] update rust qs --- docs/getting-started/rust.mdx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/getting-started/rust.mdx b/docs/getting-started/rust.mdx index 1663fcf..74177bb 100644 --- a/docs/getting-started/rust.mdx +++ b/docs/getting-started/rust.mdx @@ -2,6 +2,10 @@ Get started with our official cross-platform Rust Crate. +:::tip +To find the most accurate documentation for Rust please visit https://docs.rs/velopack +::: + 1. Add Velopack to your `Cargo.toml`: ```toml [dependencies] @@ -28,7 +32,8 @@ Get started with our official cross-platform Rust Crate. use anyhow::Result; fn update_my_app() -> Result<()> { - let um = UpdateManager::new("https://the.place/you-host/updates", None)?; + let source = sources::HttpSource::new("https://the.place/you-host/updates"); + let um = UpdateManager::new(source, None)?; // check for updates let updates: Option = um.check_for_updates()?; @@ -38,11 +43,11 @@ Get started with our official cross-platform Rust Crate. // download updates let updates = updates.unwrap(); - um.download_updates(&updates, |progress| { + um.download_updates(&updates, |progress| { println!("Download progress: {}%", progress); })?; - // apply updates + // apply and restart um.apply_updates_and_restart(&updates, RestartArgs::None)?; Ok(()) }