mirror of
https://github.com/sxyazi/yazi.git
synced 2026-05-13 08:16:40 +00:00
refactor: refine PathLike and StrandLike traits (#3340)
This commit is contained in:
parent
9cd742811a
commit
d3ad1c0920
109 changed files with 1282 additions and 1492 deletions
|
|
@ -8,6 +8,9 @@ description = "Yazi SFTP client"
|
|||
homepage = "https://yazi-rs.github.io"
|
||||
repository = "https://github.com/sxyazi/yazi"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
bitflags = { workspace = true }
|
||||
parking_lot = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ impl<'a> From<&'a str> for ByteStr<'a> {
|
|||
fn from(value: &'a str) -> Self { ByteStr(Cow::Borrowed(value.as_bytes())) }
|
||||
}
|
||||
|
||||
impl<'a> From<&'a ByteStr<'a>> for ByteStr<'a> {
|
||||
impl<'a> From<&'a Self> for ByteStr<'a> {
|
||||
fn from(value: &'a ByteStr) -> Self { ByteStr(Cow::Borrowed(&value.0)) }
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ impl<'a> ByteStr<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn join(&self, other: impl Into<ByteStr<'a>>) -> PathBuf {
|
||||
pub fn join(&self, other: impl Into<Self>) -> PathBuf {
|
||||
let other = other.into();
|
||||
match self.to_path() {
|
||||
Cow::Borrowed(p) => p.join(other.to_path()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue