refactor: refine PathLike and StrandLike traits (#3340)

This commit is contained in:
三咲雅 misaki masa 2025-11-19 18:07:04 +08:00 committed by GitHub
parent 9cd742811a
commit d3ad1c0920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
109 changed files with 1282 additions and 1492 deletions

View file

@ -8,6 +8,9 @@ description = "Yazi file manager"
homepage = "https://yazi-rs.github.io"
repository = "https://github.com/sxyazi/yazi"
[lints]
workspace = true
[profile.release]
codegen-units = 1
lto = true

View file

@ -3,7 +3,7 @@ use yazi_actor::Ctx;
use yazi_boot::BOOT;
use yazi_macro::act;
use yazi_parser::{VoidOpt, mgr::CdSource};
use yazi_shared::{data::Data, strand::StrandBufLike, url::UrlLike};
use yazi_shared::{data::Data, strand::StrandLike, url::UrlLike};
use crate::app::App;

View file

@ -4,7 +4,7 @@ use ratatui::{buffer::Buffer, layout::Rect, widgets::{Block, BorderType, List, L
use yazi_adapter::Dimension;
use yazi_config::{THEME, popup::{Offset, Position}};
use yazi_core::Core;
use yazi_shared::strand::{AsStrand, StrandLike};
use yazi_shared::strand::StrandLike;
pub(crate) struct Cmp<'a> {
core: &'a Core,
@ -26,7 +26,7 @@ impl Widget for Cmp<'_> {
let icon = if x.is_dir { &THEME.cmp.icon_folder } else { &THEME.cmp.icon_file };
let slash = if x.is_dir { MAIN_SEPARATOR_STR } else { "" };
let mut item = ListItem::new(format!(" {icon} {}{slash}", x.name.as_strand().display()));
let mut item = ListItem::new(format!(" {icon} {}{slash}", x.name.display()));
if i == self.core.cmp.rel_cursor() {
item = item.style(THEME.cmp.active);
} else {