fix endpoint display bug

Signed-off-by: mujunxiang <1948535941@qq.com>
This commit is contained in:
mujunxiang
2024-11-27 15:00:16 +08:00
parent 13b53efb2a
commit bbe3d9231e
2 changed files with 3 additions and 9 deletions
+1 -7
View File
@@ -30,13 +30,7 @@ pub struct Endpoint {
impl Display for Endpoint {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if self.url.scheme() == "file" {
write!(
f,
"{}",
fs::canonicalize(self.url.path())
.map_err(|_| std::fmt::Error)?
.to_string_lossy()
)
write!(f, "{}", self.url.path())
} else {
write!(f, "{}", self.url)
}