From 9df59059f0c1b3c123b1ae5be49e12418302ccea Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 16 Oct 2023 14:20:15 +0200 Subject: Style with clippy --- src/trace.rs | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'src/trace.rs') diff --git a/src/trace.rs b/src/trace.rs index e9ca481..bd38fa4 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -59,25 +59,18 @@ pub fn trace(pid: Pid, args: &Args) -> anyhow::Result> { // because it could be equals except for the `rax` register. let mut have_to_print = true; - loop { - match trace_next(pid)? { - Some(reg) => { - have_to_print ^= true; - if have_to_print { - if let Some(ref mut f) = f { - writeln!(f, "{}", reg.output())?; - } - - if args.no_tui { - writeln!(io::stdout(), "{}", reg.output())?; - } - - lines.push(reg); - } + while let Some(reg) = trace_next(pid)? { + have_to_print ^= true; + if have_to_print { + if let Some(ref mut f) = f { + writeln!(f, "{}", reg.output())?; } - None => { - break; + + if args.no_tui { + writeln!(io::stdout(), "{}", reg.output())?; } + + lines.push(reg); } } Ok(lines) -- cgit v1.2.3-18-g5258