Skip to content

Commit cfc1364

Browse files
committed
refactor link spam
1 parent 39a4024 commit cfc1364

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/run.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,14 @@ fn create_vscode_tasks_json(Context { meta, vscode, .. }: &Context) -> io::Resul
322322
}
323323
}
324324

325-
if let Some(repository) = package.repository.as_ref() {
326-
write_open_link(&mut o, &format!("open repository ({})", package.name), &repository, "")?;
327-
}
328-
if let Some(documentation) = package.documentation.as_ref() {
329-
write_open_link(&mut o, &format!("open documentation ({})", package.name), &documentation, "")?;
330-
}
331-
if let Some(homepage) = package.homepage.as_ref() {
332-
write_open_link(&mut o, &format!("open homepage ({})", package.name), &homepage, "")?;
325+
for (label, link) in [
326+
("repository", package.repository .as_deref()),
327+
("documentation", package.documentation .as_deref()),
328+
("homepage", package.homepage .as_deref()),
329+
] {
330+
if let Some(link) = link {
331+
write_open_link(&mut o, &format!("open {label} ({})", package.name), link, "")?;
332+
}
333333
}
334334
}
335335

0 commit comments

Comments
 (0)