Update used crates

This commit is contained in:
UTAKERDEV 2025-05-08 20:51:58 +02:00
parent eff3bccf2b
commit 7c53183bb3
3 changed files with 81 additions and 744 deletions

810
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -5,5 +5,5 @@ edition = "2024"
[dependencies]
eframe = "0.31.1"
git2 = "0.20.1"
reqwest = {version = "0.12.15", features = ["blocking", "rustls-tls"] }
git2 = "0.20.2"
ureq = "3.0.11"

View file

@ -1,15 +1,18 @@
// Import std crate
use std::io::Read;
use std::process::Command;
use std::fs;
use std::path::Path;
// Funtion for Downloading and installing rust automatically
// Function for downloading and installing Rust automatically
pub fn download_install_rust() -> Result<(), Box<dyn std::error::Error>> {
let url = "https://win.rustup.rs/x86_64";
let exe_name = "rustup-init.exe";
let response = reqwest::blocking::get(url)?;
let bytes = response.bytes()?;
let mut response = ureq::get(url).call()?;
let mut reader = response.body_mut().as_reader();
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes)?;
fs::write(exe_name, &bytes)?;
println!("[✓] Download finished: {}", exe_name);
@ -25,7 +28,6 @@ pub fn download_install_rust() -> Result<(), Box<dyn std::error::Error>> {
return Ok(());
}
// Downloading and Install Windows MSVC for building the PS
let status_stable = Command::new("rustup")
.args(["install", "stable-x86_64-pc-windows-msvc"])
.status()?;
@ -36,7 +38,6 @@ pub fn download_install_rust() -> Result<(), Box<dyn std::error::Error>> {
eprintln!("[✗] Failed to install stable MSVC toolchain.");
}
// Cleaning
if Path::new(exe_name).exists() {
fs::remove_file(exe_name)?;
println!("[✓] Cleanup finished.");