summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 8ea2a45..982cc52 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -255,6 +255,8 @@ struct Reformat {
impl Reformat {
fn run(&self, _opt: &Opt, book: &AddressBook) -> anyhow::Result<()> {
+ let mut entries: Vec<Entry> = book.entries().to_vec();
+ entries.sort_by_cached_key(|e| e.name.clone());
if self.stdout {
serde_yaml::to_writer(std::io::stdout(), book.entries())?;
} else {