From 012bf0593df7bf93afb73db5c87dd8ccc36e851f Mon Sep 17 00:00:00 2001 From: Max Audron Date: Tue, 7 Jun 2022 12:28:18 +0200 Subject: move to mostly sync architecture the git repository struct is not sharable between threads, thus go single threaded for now and only call onto the tokio runtime for lookups towards gitlab. --- src/list/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/list/mod.rs') diff --git a/src/list/mod.rs b/src/list/mod.rs index ed71e6a..0bf6872 100644 --- a/src/list/mod.rs +++ b/src/list/mod.rs @@ -1,10 +1,14 @@ use anyhow::Result; +use itertools::Itertools; use crate::repo::Repos; impl crate::GTree { - pub async fn list(&self, repos: Repos) -> Result<()> { - repos.iter().for_each(|repo| println!("{}", repo)); + pub fn list(&self, repos: Repos) -> Result<()> { + repos.iter().sorted_by_key(|x| x.0).for_each(|(_, repo)| { + let repo = repo.read().unwrap(); + println!("{}", repo) + }); Ok(()) } -- cgit v1.2.3