From 7c2b573cfaa66608bf4c1a833226d9d9184cc2f4 Mon Sep 17 00:00:00 2001 From: Tricked Date: Thu, 29 Sep 2022 20:29:44 +0200 Subject: [PATCH] add cargo meta --- Cargo.toml | 19 +++++++++++++++++++ build.rs | 14 ++++++++------ src/lib.rs | 10 ++++------ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4e37bb5..1a0d4bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,19 @@ edition = "2021" name = "lowestbins" version = "1.3.0" +authors = ["Tricked-dev "] +description = "Lowestbins made in rust for maximum efficiency" +repository = "https://github.com/tricked-dev/lowestbins" +documentation = "https://docs.rs/lowestbins" +readme = "README.md" +license = "APACHE-2.0" +homepage = "https://lb.tricked.pro" +categories = ["command-line-utilities"] +exclude = [ + ".vscode/settings.json", + "makefile", +] + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] @@ -12,6 +25,12 @@ local = [] [profile.release] lto = true strip = true +codegen-units = 1 +incremental = true +opt-level = 'z' + +[profile.release.package."*"] +opt-level = 3 [build-dependencies] colored = "2.0" diff --git a/build.rs b/build.rs index 1cb414d..bdd28c3 100644 --- a/build.rs +++ b/build.rs @@ -27,10 +27,12 @@ fn main() { fs::write(format!("{}/logo.txt", &env::var("OUT_DIR").unwrap()), res).unwrap(); let output = format!("{}/sellprices.json", &env::var("OUT_DIR").unwrap()); println!("cargo:rerun-if-changed={}", output); - let _cmd = Command::new("curl") - .arg("-o") - .arg(output) - .arg(LOC) - .output() - .expect("failed to execute process"); + if fs::read(&output).is_err() { + let _cmd = Command::new("curl") + .arg("-o") + .arg(output) + .arg(LOC) + .output() + .expect("failed to execute process"); + } } diff --git a/src/lib.rs b/src/lib.rs index 50d3b95..6012257 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,16 +1,14 @@ +#![doc = include_str!("../README.md")] + pub mod bazaar; pub mod fetch; pub mod nbt_utils; pub mod server; pub mod webhook; -use std::{collections::HashMap, env, fs, sync::Mutex, time::Duration}; +use std::{collections::HashMap, env, fs, sync::Mutex}; -use isahc::{ - config::{NetworkInterface, VersionNegotiation}, - prelude::*, - HttpClient, -}; +use isahc::HttpClient; const UPDATE_SECONDS: &str = "UPDATE_SECONDS"; const SAVE_TO_DISK: &str = "SAVE_TO_DISK";