mirror of
https://github.com/sxyazi/yazi.git
synced 2026-05-13 08:16:40 +00:00
refactor: simplify FromStr implementations with strum
This commit is contained in:
parent
4857d46918
commit
ad655eda52
31 changed files with 108 additions and 231 deletions
|
|
@ -16,9 +16,9 @@ workspace = true
|
|||
yazi-macro = { path = "../yazi-macro", version = "26.2.2" }
|
||||
|
||||
# External dependencies
|
||||
crossterm = { workspace = true }
|
||||
ratatui = { workspace = true }
|
||||
twox-hash = { workspace = true }
|
||||
crossterm = { workspace = true }
|
||||
ratatui = { workspace = true }
|
||||
twox-hash = { workspace = true }
|
||||
unicode-width = { workspace = true }
|
||||
|
||||
[dependencies.unicode-segmentation]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
yazi_macro::mod_pub!(crossterm ratatui);
|
||||
yazi_macro::mod_pub!(crossterm ratatui strum);
|
||||
|
||||
yazi_macro::mod_flat!(twox);
|
||||
|
|
|
|||
1
yazi-shim/src/strum/mod.rs
Normal file
1
yazi-shim/src/strum/mod.rs
Normal file
|
|
@ -0,0 +1 @@
|
|||
yazi_macro::mod_flat!(traits);
|
||||
10
yazi-shim/src/strum/traits.rs
Normal file
10
yazi-shim/src/strum/traits.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
pub trait IntoStr {
|
||||
fn into_str(self) -> &'static str;
|
||||
}
|
||||
|
||||
impl<T> IntoStr for T
|
||||
where
|
||||
T: Into<&'static str>,
|
||||
{
|
||||
fn into_str(self) -> &'static str { self.into() }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue