From c52169f535f89c0300ec06e13ddcaa7e0f459a0b Mon Sep 17 00:00:00 2001 From: Jonas Maier Date: Mon, 1 Jun 2026 21:17:23 +0200 Subject: clippy --- src/run/builtin.rs | 12 ++++++------ src/run/mod.rs | 2 +- src/run/var/mod.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/run') diff --git a/src/run/builtin.rs b/src/run/builtin.rs index 6f7cc5d..f3682f7 100644 --- a/src/run/builtin.rs +++ b/src/run/builtin.rs @@ -187,7 +187,7 @@ impl Builtin for _type { let session = session.lock().unwrap(); for arg in args { if let Some((_, a)) = session.aliases.get(arg, AliasAge::MAX) { - stdout.write_all(&arg)?; + stdout.write_all(arg)?; stdout.write_all(b" is aliased to ")?; stdout.write_all(&a.unparsed)?; stdout.write_all(b"\n")?; @@ -385,7 +385,7 @@ impl Builtin for parse { } Err(e) => { writeln!(stdout, "err {e:?} ")?; - stdout.write_all(&c.remaining())?; + stdout.write_all(c.remaining())?; } } } @@ -508,7 +508,7 @@ impl Builtin for alias { } Err(err) => { writeln!(stdout, "alias: unparseable argument ({err:?}): ",)?; - stdout.write_all(&arg)?; + stdout.write_all(arg)?; parse_fail = true; } } @@ -525,7 +525,7 @@ impl Builtin for alias { if !a.is_empty() { a.push(b' '); } - a.push_all(&b); + a.push_all(b); a }), parsed: alias_args, @@ -995,7 +995,7 @@ impl Builtin for pish_theme { stdout.write_all(b" ")?; } stdout.write_all(b"\n")?; - return Err(Error::Exit(-1)); + Err(Error::Exit(-1)) }; if args.is_empty() { @@ -1066,7 +1066,7 @@ mod dbg { } _ => { stdout.write_all(b"debug: unknown option ")?; - stdout.write_all(&arg)?; + stdout.write_all(arg)?; } } } diff --git a/src/run/mod.rs b/src/run/mod.rs index c3ceb76..009954b 100644 --- a/src/run/mod.rs +++ b/src/run/mod.rs @@ -640,7 +640,7 @@ pub fn run(se: Arc>, parsed: Ast) -> String { match result { Ok(_) => String::new(), - Err(e) => format!("{}", e.error_message()), + Err(e) => e.error_message(), } } diff --git a/src/run/var/mod.rs b/src/run/var/mod.rs index 1ccc195..57ff9e1 100644 --- a/src/run/var/mod.rs +++ b/src/run/var/mod.rs @@ -62,7 +62,7 @@ impl Vars { for var in vars { self.watched .entry(var) - .or_insert_with(Vec::new) + .or_default() .push(watch.weak()); } watch -- cgit v1.2.3