From dd9d2449f89410d600611dd5a0f563b1f06082f6 Mon Sep 17 00:00:00 2001 From: suneettipirneni Date: Sat, 1 Jun 2024 13:09:08 -0400 Subject: [PATCH] use query string helper --- twilight-http/src/routing.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/twilight-http/src/routing.rs b/twilight-http/src/routing.rs index d7b8acfcef3..def7b0facd1 100644 --- a/twilight-http/src/routing.rs +++ b/twilight-http/src/routing.rs @@ -1835,18 +1835,9 @@ impl Display for Route<'_> { Display::fmt(answer_id, f)?; f.write_str("?")?; - if let Some(after) = after { - f.write_str("after=")?; - Display::fmt(after, f)?; - f.write_str("&")?; - } - - if let Some(limit) = limit { - f.write_str("limit=")?; - Display::fmt(limit, f)?; - } - - Ok(()) + let mut writer = QueryStringFormatter::new(f); + writer.write_opt_param("after", after.as_ref())?; + writer.write_opt_param("limit", limit.as_ref()) } Route::GetGlobalCommands { application_id,