diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-04-23 08:44:30 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-04-23 08:44:30 +0300 |
commit | aec6ce99b9582c936870fc274e9d5d5183ecf19d (patch) | |
tree | 866b9271f9a6b4cb703891000c0a3114e0639633 | |
parent | b245389cfeed2a3a222ab512feb6449f610c2d9c (diff) | |
download | summain-rs-aec6ce99b9582c936870fc274e9d5d5183ecf19d.tar.gz |
refactor: Move report into func
-rw-r--r-- | src/bin/summain.rs | 9 |
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 |