feat: removed more code/dependencies

This commit is contained in:
Byson94
2025-09-29 12:04:37 +05:30
parent c59f3f3683
commit 52182d3b4e
7 changed files with 1 additions and 225 deletions

View File

@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- Legacy `true`/`false` support for `focusable` window property.
- `$INPUT_VAL` variable injected in commands ran by input widget.
- Many dependencies and code for faster build and lesser binary size.
## [0.1.4] - 2025-09-18

117
Cargo.lock generated
View File

@@ -46,21 +46,6 @@ version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "anstream"
version = "0.6.15"
@@ -233,15 +218,6 @@ dependencies = [
"system-deps 6.2.2",
]
[[package]]
name = "cc"
version = "1.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0"
dependencies = [
"shlex",
]
[[package]]
name = "cfg-expr"
version = "0.15.8"
@@ -274,21 +250,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "chrono"
version = "0.4.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"pure-rust-locales",
"wasm-bindgen",
"windows-link",
]
[[package]]
name = "clap"
version = "4.5.18"
@@ -380,12 +341,6 @@ dependencies = [
"tiny-keccak",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "cpufeatures"
version = "0.2.14"
@@ -1137,29 +1092,6 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "iana-time-zone"
version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "ident_case"
version = "1.0.1"
@@ -1680,12 +1612,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "pure-rust-locales"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a"
[[package]]
name = "quote"
version = "1.0.37"
@@ -1740,26 +1666,6 @@ dependencies = [
"bitflags 2.6.0",
]
[[package]]
name = "ref-cast"
version = "1.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d"
dependencies = [
"ref-cast-impl",
]
[[package]]
name = "ref-cast-impl"
version = "1.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.87",
]
[[package]]
name = "regex"
version = "1.10.6"
@@ -1972,19 +1878,11 @@ name = "shared_utils"
version = "0.1.0"
dependencies = [
"anyhow",
"chrono",
"derive_more",
"ref-cast",
"rhai",
"serde",
]
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "signal-hook-registry"
version = "1.4.2"
@@ -2441,21 +2339,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-link"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
[[package]]
name = "windows-sys"
version = "0.48.0"

View File

@@ -11,7 +11,6 @@ anyhow = "1.0.86"
ahash = "0.8.12"
bincode = "1.3.3"
bytesize = "2.0.1"
chrono = "0.4.38"
clap = { version = "4.5.1", features = ["derive"] }
clap_complete = "4.5.12"
codespan-reporting = "0.11"
@@ -34,7 +33,6 @@ notify = "6.1.1"
once_cell = "1.19"
pretty_assertions = "1.4.0"
pretty_env_logger = "0.5.0"
ref-cast = "1.0.22"
regex = "1.10.5"
rhai = { version = "1.22.2", features = ["internals"] }
serde_json = "1.0"

View File

@@ -11,7 +11,5 @@ homepage = "https://github.com/elkowar/eww"
[dependencies]
serde.workspace = true
derive_more.workspace = true
ref-cast.workspace = true
chrono = { workspace = true, features = ["unstable-locales"] }
rhai = { version = "1.22.2" }
anyhow.workspace = true

View File

@@ -1,8 +1,4 @@
pub mod extract_props;
pub mod locale;
pub mod span;
pub mod wrappers;
pub use locale::*;
pub use span::*;
pub use wrappers::*;

View File

@@ -1,11 +0,0 @@
use chrono::Locale;
use std::env::var;
/// Returns the `Locale` enum based on the `LC_ALL`, `LC_TIME`, and `LANG` environment variables in
/// that order, which is the precedence order prescribed by Section 8.2 of POSIX.1-2017.
/// If the environment variable is not defined or is malformed use the POSIX locale.
pub fn get_locale() -> Locale {
var("LC_ALL").or_else(|_| var("LC_TIME")).or_else(|_| var("LANG")).map_or(Locale::POSIX, |v| {
v.split('.').next().and_then(|x| x.try_into().ok()).unwrap_or_default()
})
}

View File

@@ -1,89 +0,0 @@
use derive_more::{Debug, *};
use ref_cast::RefCast;
use serde::{Deserialize, Serialize};
/// The name of a variable
#[repr(transparent)]
#[derive(
Clone,
Hash,
PartialEq,
Eq,
Serialize,
Deserialize,
AsRef,
From,
FromStr,
Display,
Debug,
RefCast,
)]
#[debug("VarName({})", _0)]
pub struct VarName(pub String);
impl std::borrow::Borrow<str> for VarName {
fn borrow(&self) -> &str {
&self.0
}
}
impl AttrName {
pub fn to_attr_name_ref(&self) -> &AttrName {
AttrName::ref_cast(&self.0)
}
}
impl From<&str> for VarName {
fn from(s: &str) -> Self {
VarName(s.to_owned())
}
}
impl From<AttrName> for VarName {
fn from(x: AttrName) -> Self {
VarName(x.0)
}
}
/// The name of an attribute
#[repr(transparent)]
#[derive(
Clone,
Hash,
PartialEq,
Eq,
Serialize,
Deserialize,
AsRef,
From,
FromStr,
Display,
Debug,
RefCast,
)]
#[debug("AttrName({})", _0)]
pub struct AttrName(pub String);
impl AttrName {
pub fn to_var_name_ref(&self) -> &VarName {
VarName::ref_cast(&self.0)
}
}
impl std::borrow::Borrow<str> for AttrName {
fn borrow(&self) -> &str {
&self.0
}
}
impl From<&str> for AttrName {
fn from(s: &str) -> Self {
AttrName(s.to_owned())
}
}
impl From<VarName> for AttrName {
fn from(x: VarName) -> Self {
AttrName(x.0)
}
}