diff --git a/src/utils/bat/output.rs b/src/utils/bat/output.rs index e93fe2ca9..c3f4a04ad 100644 --- a/src/utils/bat/output.rs +++ b/src/utils/bat/output.rs @@ -51,6 +51,14 @@ pub enum OutputType { Stdout(io::Stdout), } +impl Drop for OutputType { + fn drop(&mut self) { + if let OutputType::Pager(ref mut command) = *self { + let _ = command.wait(); + } + } +} + impl OutputType { /// Create a pager and write all data into it. Waits until the pager exits. /// The expectation is that the program will exit afterwards. @@ -241,11 +249,3 @@ delta is not an appropriate value for $PAGER \ None } } - -impl Drop for OutputType { - fn drop(&mut self) { - if let OutputType::Pager(ref mut command) = *self { - let _ = command.wait(); - } - } -}