Skip to content

Commit

Permalink
fix(handlers): remove redundant references
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Mar 23, 2024
1 parent 569d5cb commit cdbeb60
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions viz-handlers/src/serve/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl Directory {
parent
.file_name()
.and_then(OsStr::to_str)
.unwrap_or("")
.unwrap_or_default()
.to_string(),
false,
None,
Expand Down Expand Up @@ -107,9 +107,9 @@ impl Display for Directory {
write!(
f,
include_str!("list.tpl"),
name = &self.name,
paths = &self.paths,
files = &self.files
name = self.name,
paths = self.paths,
files = self.files
)
}
}
Expand All @@ -121,7 +121,7 @@ pub(crate) struct Paths(Vec<(String, String)>);
impl Display for Paths {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
for (url, name) in &self.0 {
writeln!(f, r#"<a href="{}">{}</a>"#, &url, &name)?;
writeln!(f, r#"<a href="{url}">{name}</a>"#)?;
}
Ok(())
}
Expand All @@ -137,14 +137,14 @@ impl Display for Files {
writeln!(
f,
r#"<li><a href="/{}" title="{}" class="{} {}">{}</a></li>"#,
&relative,
&title,
relative,
title,
if *kind { "file" } else { "folder" },
match &ext {
Some(ext) => ext,
None => "",
},
&base
base
)?;
}
Ok(())
Expand Down

0 comments on commit cdbeb60

Please sign in to comment.