From f8fa6fec782f12955bb9983abec87eff166e60a3 Mon Sep 17 00:00:00 2001 From: AnthonyMichaelTDM <68485672+AnthonyMichaelTDM@users.noreply.github.com> Date: Mon, 18 Apr 2022 13:28:25 -0700 Subject: [PATCH] still not working hmmm --- 32_Diamond/rust/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/32_Diamond/rust/src/lib.rs b/32_Diamond/rust/src/lib.rs index b86adb2e..17aa2e0c 100644 --- a/32_Diamond/rust/src/lib.rs +++ b/32_Diamond/rust/src/lib.rs @@ -105,7 +105,12 @@ fn print_diamonds(width:isize, count:isize) { step = -2; } //separate line by LINE_WIDTH or whatever - println!("{}", line); + while line.len() >= LINE_WIDTH as usize { + let line_parts = line.split_at(LINE_WIDTH as usize); + println!("{}",line_parts.0); + + line = String::from(line_parts.1); + } }