git.delta.rocks / jrsonnet / refs/commits / 6eba9c3aac87

difftreelog

fix(cli) gc stats were always printed

Yaroslav Bolyukin2022-08-05parent: #cfd533f.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-cli/src/lib.rsdiffbeforeafterboth
102}102}
103impl GcOpts {103impl GcOpts {
104 pub fn stats_printer(&self) -> (Option<GcStatsPrinter>, Option<LeakSpace>) {104 pub fn stats_printer(&self) -> (Option<GcStatsPrinter>, Option<LeakSpace>) {
105 // Constructed structs have side-effects in Drop impl
106 #[allow(clippy::unnecessary_lazy_evaluations)]
105 (107 (
106 self.gc_print_stats.then_some(GcStatsPrinter {108 self.gc_print_stats.then(|| GcStatsPrinter {
107 collect_before_printing_stats: self.gc_collect_before_printing_stats,109 collect_before_printing_stats: self.gc_collect_before_printing_stats,
108 }),110 }),
109 (!self.gc_collect_on_exit).then_some(LeakSpace {}),111 (!self.gc_collect_on_exit).then(|| LeakSpace {}),
110 )112 )
111 }113 }
112}114}