From b2fe275aa4486cfcb54e8149878402f64b0c84dd Mon Sep 17 00:00:00 2001 From: brian cully Date: Mon, 29 Dec 2025 20:44:00 -0500 Subject: wasm: string interpolation --- src/point.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/point.rs') diff --git a/src/point.rs b/src/point.rs index 18d3d5f..34cdb69 100644 --- a/src/point.rs +++ b/src/point.rs @@ -3,12 +3,12 @@ use crate::state::{MAX_SPEED, TAU}; const POINT_RADIUS: f64 = 0.01; fn rand_color() -> String { - format!( - "rgb({} {} {})", + let [r, g, b] = [ fastrand::u8(0..255), fastrand::u8(0..255), - fastrand::u8(0..255) - ) + fastrand::u8(0..255), + ]; + format!("rgb({r} {g} {b})",) } #[derive(Clone, Debug)] -- cgit v1.3