Unicorn rust bindings improvements

This commit is contained in:
Dominik Maier
2021-11-08 19:34:53 +01:00
parent 06f454d513
commit f8f0d4471f
16 changed files with 417 additions and 388 deletions

View File

@@ -1,11 +1,11 @@
use bytes::Buf;
use flate2::read::GzDecoder;
use reqwest::header::USER_AGENT;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::{env, process::Command};
use tar::Archive;
fn find_unicorn(unicorn_dir: &PathBuf) -> Option<PathBuf> {
fn find_unicorn(unicorn_dir: &Path) -> Option<PathBuf> {
for entry in std::fs::read_dir(unicorn_dir).ok()? {
let entry = entry.unwrap();
let path = entry.path();
@@ -49,6 +49,7 @@ fn download_unicorn() -> Option<String> {
}
}
#[allow(clippy::branches_sharing_code)]
fn main() {
let profile = env::var("PROFILE").unwrap();