diff --git a/src/main.rs b/src/main.rs index 002fb34..f2597b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,7 +94,9 @@ fn add(id: &String) -> io::Result<()> { fn list() -> io:: Result<()> { let db = read_db()?; - for item in db.iter() { + let mut vec: Vec<_> = db.iter().collect(); + vec.sort(); + for item in &vec { println!("{}", item); } Ok(())