mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
caafaa5d40
commit
b2c6d673c1
2 changed files with 5 additions and 5 deletions
|
|
@ -47,7 +47,7 @@ impl<'a> ByteStr<'a> {
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
{
|
{
|
||||||
match super::wtf::bytes_to_wide(self.0.as_ref()) {
|
match super::wtf::bytes_to_wide(self.0.as_ref()) {
|
||||||
Cow::Borrowed(_) => self.0.into_owned(),
|
Cow::Borrowed(_) => unsafe { String::from_utf8_unchecked(self.0.into_owned()) }.into(),
|
||||||
Cow::Owned(s) => s,
|
Cow::Owned(s) => s,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -102,7 +102,7 @@ where
|
||||||
}
|
}
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
{
|
{
|
||||||
super::wtf::wide_to_bytes(self.as_ref())
|
super::wtf::wide_to_bytes(self.as_ref().as_os_str())
|
||||||
.ok_or(Error::custom("failed to convert wide path to bytes"))
|
.ok_or(Error::custom("failed to convert wide path to bytes"))
|
||||||
.map(ByteStr)
|
.map(ByteStr)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@ impl Provider for Sftp {
|
||||||
let attrs = Attrs::from(Cha(cha));
|
let attrs = Attrs::from(Cha(cha));
|
||||||
|
|
||||||
let op = self.op().await?;
|
let op = self.op().await?;
|
||||||
let from = op.open(from.as_ref(), Flags::READ, &Attrs::default()).await?;
|
let from = op.open(&from, Flags::READ, &Attrs::default()).await?;
|
||||||
let to = op.open(to.as_ref(), Flags::WRITE | Flags::CREATE | Flags::TRUNCATE, &attrs).await?;
|
let to = op.open(&to, Flags::WRITE | Flags::CREATE | Flags::TRUNCATE, &attrs).await?;
|
||||||
|
|
||||||
let mut reader = BufReader::with_capacity(524288, from);
|
let mut reader = BufReader::with_capacity(524288, from);
|
||||||
let mut writer = BufWriter::with_capacity(524288, to);
|
let mut writer = BufWriter::with_capacity(524288, to);
|
||||||
|
|
@ -101,7 +101,7 @@ impl Provider for Sftp {
|
||||||
where
|
where
|
||||||
P: AsRef<Path>,
|
P: AsRef<Path>,
|
||||||
{
|
{
|
||||||
Ok(self.op().await?.mkdir(path.as_ref(), Attrs::default()).await?)
|
Ok(self.op().await?.mkdir(&path, Attrs::default()).await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn gate(&self) -> io::Result<Self::Gate> {
|
async fn gate(&self) -> io::Result<Self::Gate> {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue