From 315f968e6e58daebf954eb961899211497a45a02 Mon Sep 17 00:00:00 2001 From: Vomitblood Date: Mon, 25 Mar 2024 15:21:59 +0800 Subject: [PATCH] renamed from pokerust to rustmon --- .github/workflows/build.yml | 6 +++--- Cargo.lock | 22 +++++++++++----------- Cargo.toml | 4 ++-- README.md | 2 +- build/arch/PKGBUILD | 6 +++--- build/debian/debian.sh | 14 +++++++------- src/bin/minimon.rs | 4 +++- 7 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd7d03a..f58b743 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: - name: Upload Arch package uses: actions/upload-artifact@v2 with: - name: pokerust.pkg.tar.zst + name: rustmon.pkg.tar.zst path: ./build/arch/*.pkg.tar build: @@ -53,5 +53,5 @@ jobs: - name: Upload Debian package uses: actions/upload-artifact@v2 with: - name: pokerust.deb - path: build/debian/pokerust.deb + name: rustmon.deb + path: build/debian/rustmon.deb diff --git a/Cargo.lock b/Cargo.lock index 3441f97..dd7705d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,17 +135,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "pokerust" -version = "0.1.0" -dependencies = [ - "clap", - "once_cell", - "rand", - "rust-embed", - "serde_json", -] - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -234,6 +223,17 @@ dependencies = [ "walkdir", ] +[[package]] +name = "rustmon" +version = "0.1.0" +dependencies = [ + "clap", + "once_cell", + "rand", + "rust-embed", + "serde_json", +] + [[package]] name = "ryu" version = "1.0.17" diff --git a/Cargo.toml b/Cargo.toml index 97b5ff7..7fcad53 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "pokerust" +name = "rustmon" version = "0.1.0" edition = "2021" [dependencies] clap = "2.0.0" -rand = "0.8" +rand = { version = "0.8.4", features = ["small_rng"] } serde_json = "1.0" once_cell = "1.8.0" rust-embed = "8.3.0" diff --git a/README.md b/README.md index defdd85..fd1e46c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PokeRust +# Rustmon *For educational purposes* A simple colorscript written in Rust. diff --git a/build/arch/PKGBUILD b/build/arch/PKGBUILD index 3f409a3..e640421 100644 --- a/build/arch/PKGBUILD +++ b/build/arch/PKGBUILD @@ -1,7 +1,7 @@ -pkgname=pokerust-git +pkgname=rustmon-git pkgdesc="Pokemon Colorscripts written in Rust" -_gitname=pokerust -pkgver=r22.ceb9133 +_gitname=rustmon +pkgver=r23.ab34e78 pkgrel=1 arch=('x86_64') url="https://github.com/Vomitblood/$_gitname" diff --git a/build/debian/debian.sh b/build/debian/debian.sh index 7d1c8be..434e695 100644 --- a/build/debian/debian.sh +++ b/build/debian/debian.sh @@ -3,8 +3,8 @@ # TODO: check for rust dependency # create a directory structure that mirrors tha final structure of the installed package -mkdir -p pokerust/DEBIAN -mkdir -p pokerust/usr/bin +mkdir -p rustmon/DEBIAN +mkdir -p rustmon/usr/bin # build the executable cd ../.. @@ -12,20 +12,20 @@ cargo build --release cd build/debian # copy the executable -cp ../../target/release/pokerust pokerust/usr/bin/ +cp ../../target/release/rustmon rustmon/usr/bin/ # create the control file -touch pokerust/DEBIAN/control +touch rustmon/DEBIAN/control # edit the control file -echo "Package: pokerust +echo "Package: rustmon Version: 1.0.0 Section: base Priority: optional Architecture: amd64 Maintainer: Vomitblood -Description: "Pokemon Colorscripts written in Rust"" > pokerust/DEBIAN/control +Description: "Pokemon Colorscripts written in Rust"" > rustmon/DEBIAN/control # actually build the thing echo $(pwd) -dpkg-deb --build pokerust \ No newline at end of file +dpkg-deb --build rustmon \ No newline at end of file diff --git a/src/bin/minimon.rs b/src/bin/minimon.rs index c13eb51..da57c34 100644 --- a/src/bin/minimon.rs +++ b/src/bin/minimon.rs @@ -1,4 +1,6 @@ use rand::prelude::SliceRandom; +use rand::rngs::SmallRng; +use rand::SeedableRng; use rust_embed::RustEmbed; use std::str; @@ -8,7 +10,7 @@ struct ColorScriptsDir; fn main() { let files: Vec<_> = ColorScriptsDir::iter().collect(); - let mut rng = rand::thread_rng(); + let mut rng = SmallRng::from_entropy(); if let Some(random_file) = files.choose(&mut rng) { println!("{}", random_file);