From 7c36061e03043cfdc4b9c18316fdd6e1374555f8 Mon Sep 17 00:00:00 2001 From: Lynnesbian Date: Thu, 23 Sep 2021 01:03:20 +1000 Subject: [PATCH] finish the cleanup job started by #59c87a37 somehow i forgot to remove all the { unreachable!() } clutter which was one of the main reasons i did the refactor in the first place... 0uo --- src/formats.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/formats.rs b/src/formats.rs index 01db525..d73b80a 100644 --- a/src/formats.rs +++ b/src/formats.rs @@ -121,14 +121,13 @@ pub fn smart_write(f: &mut W, writeables: &[Writable]) -> io::Result<( } pub trait FormatSteps { - fn rename(&self, _f: &mut W, _from: &Path, _to: &Path) -> io::Result<()> { unreachable!() } - fn no_known_extension(&self, _f: &mut W, _path: &Path) -> io::Result<()> { unreachable!() } - fn unreadable(&self, _f: &mut W, _path: &Path) -> io::Result<()> { unreachable!() } - fn unknown_type(&self, _f: &mut W, _path: &Path) -> io::Result<()> { unreachable!() } - fn header(&self, _f: &mut W, _entries: &Entries) -> io::Result<()> { unreachable!() } - fn footer(&self, _f: &mut W, _entries: &Entries) -> io::Result<()> { unreachable!() } + fn rename(&self, _f: &mut W, _from: &Path, _to: &Path) -> io::Result<()>; + fn no_known_extension(&self, _f: &mut W, _path: &Path) -> io::Result<()> ; + fn unreadable(&self, _f: &mut W, _path: &Path) -> io::Result<()>; + fn unknown_type(&self, _f: &mut W, _path: &Path) -> io::Result<()>; + fn header(&self, _f: &mut W, _entries: &Entries) -> io::Result<()>; + fn footer(&self, _f: &mut W, _entries: &Entries) -> io::Result<()>; fn write_steps(&self, f: &mut W, entries: &Entries) -> io::Result<()> { - // TODO: clean this up - it's kinda messy self.header(f, entries)?; // output will be generated in the order: