From 7d9b3d5cb233a685ef861610bfd835478fb10be1 Mon Sep 17 00:00:00 2001 From: fdai7374 Date: Fri, 3 Feb 2023 21:45:45 +0100 Subject: [PATCH] refactoring: variable name change, reformating --- src/builtins/blahaj.rs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/builtins/blahaj.rs b/src/builtins/blahaj.rs index 763bf0b..23bdee9 100644 --- a/src/builtins/blahaj.rs +++ b/src/builtins/blahaj.rs @@ -6,7 +6,7 @@ pub struct Blahaj; impl Builtin for Blahaj { fn execute(&mut self, _: &mut BuiltinConfig, args: Vec) -> Result<(), ShellError> { - let shonk=" + let blahaj = " ((/ ,(((/ /((((( (/ @@ -25,23 +25,24 @@ impl Builtin for Blahaj { .. .............,*%%%%#%((((/ **,,,****//*(##((###(#((( &#(#/#((((((((#"; - if args.is_empty() { - println!("{}",shonk); - }else { - if args[0].eq("-t") { - trans_flag(shonk); + + if args.is_empty() { + println!("{}", blahaj); + } else { + if args[0].eq("-t") { + trans_flag(blahaj); + } } - } Ok(()) } } -fn trans_flag(shonk: &str){ - for (index, lines) in shonk.lines().enumerate() { - if index%4==0 { - println!("{}",lines.truecolor(91,206,250)); - }else if index%2==0 { +fn trans_flag(blahaj: &str) { + for (index, lines) in blahaj.lines().enumerate() { + if index % 4 == 0 { + println!("{}", lines.truecolor(91, 206, 250)); + } else if index % 2 == 0 { println!("{}", lines.white()); - }else { println!("{}", lines.truecolor(245,169,184));} + } else { println!("{}", lines.truecolor(245, 169, 184)); } } } \ No newline at end of file