diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-12-30 14:16:34 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-12-30 15:25:29 +0200 |
commit | 776b2c134c3096b8a7cf1742cbcda13f0527e415 (patch) | |
tree | 032ccd40e9db637df1ff68cdb46b8deda1ade27c /src/cmd/list.rs | |
parent | 6b9553945683e2b01404673e37e8b951b32a993e (diff) | |
download | obnam2-776b2c134c3096b8a7cf1742cbcda13f0527e415.tar.gz |
feat: add GenerationList
Various part of Obnam will need to deal with lists of generations.
Abstract this.
Diffstat (limited to 'src/cmd/list.rs')
-rw-r--r-- | src/cmd/list.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cmd/list.rs b/src/cmd/list.rs index 70aa0a7..8766e34 100644 --- a/src/cmd/list.rs +++ b/src/cmd/list.rs @@ -3,9 +3,8 @@ use crate::client::{BackupClient, ClientConfig}; pub fn list(config: &ClientConfig) -> anyhow::Result<()> { let client = BackupClient::new(&config.server_url)?; - let mut generations = client.list_generations()?; - generations.sort_by_cached_key(|gen| gen.ended().to_string()); - for finished in generations { + let generations = client.list_generations()?; + for finished in generations.iter() { println!("{} {}", finished.id(), finished.ended()); } |