summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-23 08:44:30 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-23 08:44:30 +0300
commitaec6ce99b9582c936870fc274e9d5d5183ecf19d (patch)
tree866b9271f9a6b4cb703891000c0a3114e0639633
parentb245389cfeed2a3a222ab512feb6449f610c2d9c (diff)
downloadsummain-rs-aec6ce99b9582c936870fc274e9d5d5183ecf19d.tar.gz
refactor: Move report into func
-rw-r--r--src/bin/summain.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/summain.rs b/src/bin/summain.rs
index 041d68b..74c98a0 100644
--- a/src/bin/summain.rs
+++ b/src/bin/summain.rs
@@ -9,8 +9,7 @@ async fn main() -> anyhow::Result<()> {
opt.pathnames[..].sort();
for filename in opt.pathnames.iter() {
- let m = manifest(&filename).await?;
- print!("{}", serde_yaml::to_string(&m)?);
+ report(&filename).await?;
}
Ok(())
@@ -22,6 +21,12 @@ struct Opt {
pathnames: Vec<PathBuf>,
}
+async fn report(path: &Path) -> anyhow::Result<()> {
+ let m = manifest(&path).await?;
+ print!("{}", serde_yaml::to_string(&m)?);
+ Ok(())
+}
+
async fn manifest(path: &Path) -> anyhow::Result<ManifestEntry> {
ManifestEntry::new(path)
.await