fix whitespace prefix at cd_interactive

This commit is contained in:
Nguyen Duc Toan 2023-10-12 07:50:57 +07:00
parent efd3b5cf0e
commit e7557617fb
2 changed files with 4 additions and 4 deletions

View file

@ -146,7 +146,7 @@ impl Tab {
emit!(Input(InputOpt::top("Change directory:").with_value(target.to_string_lossy())));
if let Some(Ok(s)) = result.recv().await {
emit!(Cd(Url::from(s)));
emit!(Cd(Url::from(s.trim())));
}
});
false

View file

@ -42,15 +42,15 @@ impl From<&Path> for Url {
}
impl From<String> for Url {
fn from(path: String) -> Self { Self::from(PathBuf::from(path.trim())) }
fn from(path: String) -> Self { Self::from(PathBuf::from(path)) }
}
impl From<&String> for Url {
fn from(path: &String) -> Self { Self::from(PathBuf::from(path.trim())) }
fn from(path: &String) -> Self { Self::from(PathBuf::from(path)) }
}
impl From<&str> for Url {
fn from(path: &str) -> Self { Self::from(PathBuf::from(path.trim())) }
fn from(path: &str) -> Self { Self::from(PathBuf::from(path)) }
}
impl AsRef<Url> for Url {