From 3d4912778b967ad16157ccd692c0cef54c7e8403 Mon Sep 17 00:00:00 2001 From: Nor Khasyatillah Date: Fri, 16 Aug 2024 13:56:44 +0700 Subject: [PATCH] update version number to v0.4.0 + some improvements --- Cargo.lock | 2 +- Cargo.toml | 21 +++++++++++++++------ src/lib.rs | 2 +- src/main.rs | 10 +--------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3265888..49f3fa2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,7 +206,7 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lolcrab" -version = "0.3.1" +version = "0.4.0" dependencies = [ "bstr", "clap", diff --git a/Cargo.toml b/Cargo.toml index bd0571b..86f9a91 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "lolcrab" -version = "0.3.1" -authors = ["David Knaack ", "Nor Khasyatillah "] +version = "0.4.0" +authors = [ + "David Knaack ", + "Nor Khasyatillah ", +] edition = "2018" description = "Like lolcat but with noise and more colorful." keywords = ["lolcat", "rainbow"] @@ -11,9 +14,11 @@ repository = "https://github.com/mazznoer/lolcrab" documentation = "https://docs.rs/lolcrab/" license = "MIT OR Apache-2.0" exclude = [ - ".github/*", - "docs/*", - "test_data/*", + ".github/*", + "docs/*", + "scripts/*", + "test_data/*", + "Makefile", ] [profile.release] @@ -24,6 +29,11 @@ strip = true default = ["cli"] cli = ["clap", "clap_complete"] +[[bin]] +name = "lolcrab" +path = "src/main.rs" +required-features = ["cli"] + [dependencies] bstr = "1.9.1" clap = { version = "4.5.9", features = ["derive", "wrap_help"], optional = true } @@ -37,4 +47,3 @@ unicode-width = "0.1.10" [build-dependencies] clap = { version = "4.5.9", features = ["derive", "wrap_help"], optional = true } clap_complete = { version = "4.5.8", optional = true } -#colorgrad = { version = "0.7.0" } diff --git a/src/lib.rs b/src/lib.rs index 201b4b1..65cae18 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ use std::process; mod cli; #[cfg(feature = "cli")] -pub use cli::*; +pub use cli::{Gradient, Opt}; pub struct Lolcrab { pub gradient: Box, diff --git a/src/main.rs b/src/main.rs index 6597133..cb806b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,21 +1,17 @@ #![warn(clippy::pedantic, clippy::nursery)] -#[cfg(feature = "cli")] use clap::{CommandFactory, Parser, ValueEnum}; -#[cfg(feature = "cli")] use lolcrab::{Gradient, Lolcrab, Opt}; -#[cfg(feature = "cli")] use std::{ fs::File, io::{self, BufReader, Write}, path::PathBuf, }; -#[cfg(all(feature = "cli", feature = "mimalloc"))] +#[cfg(feature = "mimalloc")] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; -#[cfg(feature = "cli")] const SAMPLE_TEXT: &str = "\ oooo............oooo...github.com/mazznoer/lolcrab...o8. `888............`888...............................'888. @@ -26,7 +22,6 @@ oooo............oooo...github.com/mazznoer/lolcrab...o8. o888o.`Y8bod8P'.o888o.`Y8bod8P'.d888b....`Y888''8o..`Y8bod8P. "; -#[cfg(feature = "cli")] fn main() -> Result<(), io::Error> { let opt = Opt::parse(); let stdout = io::stdout(); @@ -99,6 +94,3 @@ fn main() -> Result<(), io::Error> { Ok(()) } - -#[cfg(not(feature = "cli"))] -fn main() {}